MCPcopy Create free account
hub / github.com/DFHack/dfhack / clean

Function clean

plugins/cleaners.cpp:200–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198}
199
200command_result clean (color_ostream &out, vector <string> & parameters)
201{
202 bool map = false;
203 bool snow = false;
204 bool mud = false;
205 bool item_spatter = false;
206 bool units = false;
207 bool items = false;
208 bool plants = false;
209 for(size_t i = 0; i < parameters.size();i++)
210 {
211 if(parameters[i] == "map")
212 map = true;
213 else if(parameters[i] == "units")
214 units = true;
215 else if(parameters[i] == "items")
216 items = true;
217 else if(parameters[i] == "plants")
218 plants = true;
219 else if(parameters[i] == "all")
220 {
221 map = true;
222 items = true;
223 units = true;
224 plants = true;
225 }
226 else if(parameters[i] == "snow")
227 snow = true;
228 else if(parameters[i] == "mud")
229 mud = true;
230 else if(parameters[i] == "item")
231 item_spatter = true;
232 else
233 return CR_WRONG_USAGE;
234 }
235 if(!map && !units && !items && !plants)
236 return CR_WRONG_USAGE;
237
238 if(map)
239 cleanmap(out,snow,mud,item_spatter);
240 if(units)
241 cleanunits(out);
242 if(items)
243 cleanitems(out);
244 if(plants)
245 cleanplants(out);
246 return CR_OK;
247}
248
249DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands)
250{

Callers

nothing calls this directly

Calls 5

cleanmapFunction · 0.85
cleanunitsFunction · 0.85
cleanitemsFunction · 0.85
cleanplantsFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected