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

Method UseTechTest

bwapi/TestAIModule/Source/UseTechTest.cpp:5–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3using namespace std;
4using namespace BWAPI;
5UseTechTest::UseTechTest(BWAPI::TechType techType) : techType(techType),
6 startFrame(-1),
7 nextFrame(-1),
8 user(NULL),
9 targetPosition(Positions::None),
10 targetUnit(NULL),
11 isInPosition(false),
12 usedTech(false),
13 testSucceeded(false),
14 startPosition(Positions::None),
15 targetType(UnitTypes::None),
16 currentEnergy(0)
17{
18 fail = false;
19 running = false;
20 for (UnitType u : techType.whatUses())
21 {
22 if (u.isHero()==false)
23 userType = u;
24 }
25 BWAssertF(userType!=UnitTypes::None,{fail=true;return;});
26 BWAssertF(userType!=UnitTypes::Unknown,{fail=true;return;});
27}
28void UseTechTest::start()
29{
30 if (fail) return;

Callers

nothing calls this directly

Calls 2

whatUsesMethod · 0.80
isHeroMethod · 0.80

Tested by

no test coverage detected