----------------------------------------------- ENABLE FLAG ----------------------------------------------
| 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 | { |