--------------------------------------------- GET RACE ---------------------------------------------------
| 39 | } |
| 40 | //--------------------------------------------- GET RACE --------------------------------------------------- |
| 41 | BWAPI::Race PlayerImpl::getRace() const |
| 42 | { |
| 43 | BroodwarImpl.setLastError(); |
| 44 | if ( this->index < BW::PLAYABLE_PLAYER_COUNT ) |
| 45 | { |
| 46 | Race rlast = BroodwarImpl.lastKnownRaceBeforeStart[this->index]; |
| 47 | if ( rlast != Races::Zerg && |
| 48 | rlast != Races::Terran && |
| 49 | rlast != Races::Protoss && |
| 50 | !this->wasSeenByBWAPIPlayer && |
| 51 | !BroodwarImpl.isFlagEnabled(Flag::CompleteMapInformation) ) |
| 52 | { |
| 53 | BroodwarImpl.setLastError(Errors::Access_Denied); |
| 54 | return Races::Unknown; |
| 55 | } |
| 56 | } |
| 57 | return BWAPI::Race( BW::BWDATA::Players[index].nRace ); |
| 58 | } |
| 59 | //--------------------------------------------- GET TYPE --------------------------------------------------- |
| 60 | BWAPI::PlayerType PlayerImpl::getType() const |
| 61 | { |
no test coverage detected