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

Method getRace

bwapi/BWAPI/Source/BWAPI/PlayerImpl.cpp:41–58  ·  view source on GitHub ↗

--------------------------------------------- GET RACE ---------------------------------------------------

Source from the content-addressed store, hash-verified

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 {

Callers 7

supplyTotalMethod · 0.95
supplyUsedMethod · 0.95
onGameStartMethod · 0.45
onMatchStartMethod · 0.45
updateDataMethod · 0.45
MakeBuildingMethod · 0.45

Calls 3

setLastErrorMethod · 0.80
RaceClass · 0.70
isFlagEnabledMethod · 0.45

Tested by

no test coverage detected