public class BW
extends java.lang.Object
Constructor and Description |
---|
BW(BWEventListener listener)
The default value for
BridgeType is BWAPI4J.BridgeType.VANILLA on Windows and
BWAPI4J.BridgeType.OPENBW on Linux. |
BW(BWEventListener listener,
BWAPI4J.BridgeType bridgeType,
boolean extractBridgeDependencies)
Creates a BW instance required to start a game.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canBuildHere(TilePosition position,
UnitType type) |
boolean |
canBuildHere(TilePosition position,
UnitType type,
Worker builder) |
void |
createUnit(Player owner,
UnitType type,
int posX,
int posY) |
void |
exit() |
java.util.Collection<Player> |
getAllPlayers() |
java.util.Collection<UnitImpl> |
getAllUnits() |
Bullet |
getBullet(int bulletId) |
java.util.Collection<Bullet> |
getBullets() |
BWMap |
getBWMap() |
DamageEvaluator |
getDamageEvaluator() |
InteractionHandler |
getInteractionHandler() |
MapDrawer |
getMapDrawer() |
java.util.List<MineralPatch> |
getMineralPatches()
Gets a list of all mineral patches.
|
Player |
getPlayer(int playerId) |
Unit |
getUnit(int unitId) |
java.util.List<PlayerUnit> |
getUnits(Player player)
Gets all units for given player.
|
java.util.List<VespeneGeyser> |
getVespeneGeysers()
Gets a list of all vespene geysers.
|
void |
killUnit(Unit unit) |
void |
setUnitFactory(UnitFactory unitFactory) |
void |
startGame() |
public BW(BWEventListener listener)
BridgeType
is BWAPI4J.BridgeType.VANILLA
on Windows and
BWAPI4J.BridgeType.OPENBW
on Linux. The default value for extractDependencies
is true
.public BW(BWEventListener listener, BWAPI4J.BridgeType bridgeType, boolean extractBridgeDependencies)
listener
- listener to inform of various game eventsbridgeType
- bridge for Vanilla BW or OpenBWextractBridgeDependencies
- whether to auto-extract the bridge dependencies from the
running JAR filepublic void startGame()
public void killUnit(Unit unit)
public void exit()
public void setUnitFactory(UnitFactory unitFactory)
public BWMap getBWMap()
public MapDrawer getMapDrawer()
public DamageEvaluator getDamageEvaluator()
public InteractionHandler getInteractionHandler()
public Player getPlayer(int playerId)
public java.util.Collection<Player> getAllPlayers()
public Unit getUnit(int unitId)
public java.util.Collection<Bullet> getBullets()
public Bullet getBullet(int bulletId)
public java.util.List<PlayerUnit> getUnits(Player player)
player
- player whose units to returnPlayerUnit
public java.util.List<MineralPatch> getMineralPatches()
public java.util.List<VespeneGeyser> getVespeneGeysers()
public java.util.Collection<UnitImpl> getAllUnits()
public boolean canBuildHere(TilePosition position, UnitType type)
public boolean canBuildHere(TilePosition position, UnitType type, Worker builder)