MCPcopy Create free account
hub / github.com/bwapi/bwapi / enableFlag

Method enableFlag

bwapi/BWAPI/Source/BWAPI/GameImpl.cpp:233–270  ·  view source on GitHub ↗

----------------------------------------------- ENABLE FLAG ----------------------------------------------

Source from the content-addressed store, hash-verified

231 }
232 //----------------------------------------------- ENABLE FLAG ----------------------------------------------
233 void GameImpl::enableFlag(int flag)
234 {
235 // Enable the specified flag
236 this->setLastError();
237
238 // Don't allow flag changes after frame 0
239 if ( this->frameCount > 0 )
240 {
241 this->setLastError(Errors::Access_Denied);
242 return;
243 }
244
245 // check if index is valid
246 if ( flag < 0 || flag >= BWAPI::Flag::Max )
247 {
248 this->setLastError(Errors::Invalid_Parameter);
249 return;
250 }
251
252 // check if tournament will allow the call
253 if ( !this->tournamentCheck(Tournament::EnableFlag, &flag) )
254 return;
255
256 // Modify flag state
257 this->flags[flag] = true;
258 if ( !this->hTournamentModule )
259 {
260 switch(flag)
261 {
262 case BWAPI::Flag::CompleteMapInformation:
263 this->sendText("Enabled Flag CompleteMapInformation");
264 break;
265 case BWAPI::Flag::UserInput:
266 this->sendText("Enabled Flag UserInput");
267 break;
268 }
269 }
270 }
271 //--------------------------------------------- GET UNITS IN RECTANGLE -------------------------------------
272 Unit GameImpl::_unitFromIndex(int index)
273 {

Callers 15

onStartMethod · 0.45
initializeAIModuleMethod · 0.45
processCommandsMethod · 0.45
mainFunction · 0.45
onStartMethod · 0.45
onStartMethod · 0.45
onStartMethod · 0.45
onStartMethod · 0.45
onStartMethod · 0.45
onStartMethod · 0.45
onStartMethod · 0.45
onStartMethod · 0.45

Calls 3

setLastErrorMethod · 0.95
tournamentCheckMethod · 0.95
sendTextMethod · 0.80

Tested by 9

onStartMethod · 0.36
onStartMethod · 0.36
onStartMethod · 0.36
onStartMethod · 0.36
onStartMethod · 0.36
onStartMethod · 0.36
onStartMethod · 0.36
onStartMethod · 0.36
onStartMethod · 0.36