public class Mirror
extends java.lang.Object
The API entry point. Standard use case:
getModule() and then set an AIModule's BWEventListenerstartGame() to init the API and connect to Broodwar, then launch Broodwar from ChaosLauncher.BWEventListener.onStart() method, receive the Game object by calling getGame()
mirror.getModule().setEventListener(new DefaultBWListener()
{
public void onStart() {
game = mirror.getGame();
self = game.self();
//initialization
....
}
public void onUpdate() {
for (Unit myUnit : self.getUnits()) {
//give orders to unit
...
}
}
});
mirror.startGame();
Note: The Game object is initialized during the startGame() as well as other BWMirror API's constants.
Do not use any API releated methods/fields prior to startGame().
| Constructor and Description |
|---|
Mirror() |
public Game getGame()
public AIModule getModule()
public void startGame()
UnitType, WeaponType ) and the Game object.
This method blocks until the end of game.