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

Method execute

bwapi/BWScriptEmulator/Resources_Jump.cpp:9–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7Resources_Jump enemyresources_jump_impl(AISCRIPT::Enum::ENEMYRESOURCES_JUMP);
8
9bool Resources_Jump::execute(aithread &thread) const
10{
11 // Parameters
12 WORD wOre, wGas, wJump;
13 thread.readTuple( std::tie(wOre, wGas, wJump) );
14
15 // Get Player
16 Player player = this->getOpcode() == Enum::RESOURCES_JUMP ? Broodwar->self() : Broodwar->enemy();
17
18 // Check if player has the given amount of resources
19 if ( player && player->minerals() >= wOre && player->gas() >= wGas )
20 thread.setScriptOffset( wJump );
21
22 // Debug and return
23 thread.saveDebug(Text::Green, this->getOpcode(), "%u %u p_%04X", wOre, wGas, wJump );
24 return true;
25}

Callers

nothing calls this directly

Calls 8

getOpcodeMethod · 0.80
mineralsMethod · 0.80
gasMethod · 0.80
setScriptOffsetMethod · 0.80
saveDebugMethod · 0.80
readTupleMethod · 0.45
selfMethod · 0.45
enemyMethod · 0.45

Tested by

no test coverage detected