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

Function playerCanMatch

bwapi/BWAPI/Source/BW/TriggerEngine.cpp:41–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39 }
40
41 bool playerCanMatch(DWORD dwActionGroup, DWORD dwExecutionPlayer, DWORD dwCheckingPlayer)
42 {
43 // Return true if it's possible for the affected group to give units to the player we're checking
44 switch ( dwActionGroup )
45 {
46 case PlayerGroups::Player1:
47 case PlayerGroups::Player2:
48 case PlayerGroups::Player3:
49 case PlayerGroups::Player4:
50 case PlayerGroups::Player5:
51 case PlayerGroups::Player6:
52 case PlayerGroups::Player7:
53 case PlayerGroups::Player8:
54 return dwActionGroup == dwCheckingPlayer;
55 case PlayerGroups::AllPlayers:
56 case PlayerGroups::NonAlliedVictoryPlayers:
57 return true;
58 case PlayerGroups::Allies:
59 case PlayerGroups::Foes:
60 return dwExecutionPlayer != dwCheckingPlayer;
61 case PlayerGroups::CurrentPlayer:
62 return dwExecutionPlayer == dwCheckingPlayer;
63 case PlayerGroups::Force1:
64 case PlayerGroups::Force2:
65 case PlayerGroups::Force3:
66 case PlayerGroups::Force4:
67 return BW::BWDATA::Players[dwCheckingPlayer].nTeam == (dwActionGroup - PlayerGroups::Force1 + 1);
68 default:
69 return false;
70 };
71 }
72 bool Action::affectsGameplay(DWORD dwExecutionPlayer, DWORD dwCheckingPlayer) const
73 {
74 // Ignore disabled actions

Callers 1

affectsGameplayMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected