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

Function do_command

plugins/nestboxes.cpp:160–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158}
159
160static command_result do_command(color_ostream &out, std::vector<string> &parameters){
161 if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) {
162 out.printerr("Cannot run {} without a loaded fort.\n", plugin_name);
163 return CR_FAILURE;
164 }
165
166 if (parameters.size() == 0 || parameters[0] == "status")
167 {
168 printStatus(out);
169 return CR_OK;
170 } else if (parameters.size() > 1 && parameters[0] == "burrow") {
171 setBurrow(out, parameters[1]);
172 return CR_OK;
173 } else if (parameters[0] == "all") {
174 config.set_int(CONFIG_BURROW, -1);
175 return CR_OK;
176 } else {
177 return CR_WRONG_USAGE;
178 }
179}
180/////////////////////////////////////////////////////
181// cycle logic
182//

Callers

nothing calls this directly

Calls 3

setBurrowFunction · 0.85
printStatusFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected