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

Method isEnemy

bwapi/BWAPI/Source/BWAPI/PlayerImpl.cpp:77–82  ·  view source on GitHub ↗

--------------------------------------------- IS ALLIES WITH ---------------------------------------------

Source from the content-addressed store, hash-verified

75 }
76 //--------------------------------------------- IS ALLIES WITH ---------------------------------------------
77 bool PlayerImpl::isEnemy(const Player player) const
78 {
79 if ( !player || this->isNeutral() || player->isNeutral() || this->isObserver() || player->isObserver() )
80 return false;
81 return BW::BWDATA::Game.playerAlliances[index][ static_cast<PlayerImpl*>(player)->getIndex() ] == 0;
82 }
83 //--------------------------------------------- IS NEUTRAL -------------------------------------------------
84 bool PlayerImpl::isNeutral() const
85 {

Callers 15

canRightClickUnitFunction · 0.45
canRightClickUnitGroupedFunction · 0.45
canUseTechUnitFunction · 0.45
Military.cppFile · 0.45
HasEnemyTargetMethod · 0.45
RunJunkYardDogMethod · 0.45
updateMethod · 0.45
getStartLocationMethod · 0.45
updateDataMethod · 0.45
onGameStartMethod · 0.45
addMethod · 0.45
onMatchStartMethod · 0.45

Calls 3

isNeutralMethod · 0.95
isObserverMethod · 0.95
getIndexMethod · 0.45

Tested by 2

onStartMethod · 0.36
startMethod · 0.36