public interface RobotController
RobotPlayer is
constructed, it is passed an instance of RobotController that
controls the newly created robot.| Modifier and Type | Method and Description |
|---|---|
void |
broadcast(int channel,
int data)
Broadcasts an integer to the team-shared array at index channel.
|
void |
broadcastBoolean(int channel,
boolean data)
Broadcasts a boolean to the team-shared array at index channel.
|
void |
broadcastFloat(int channel,
float data)
Broadcasts a float to the team-shared array at index channel.
|
void |
broadcastInt(int channel,
int data)
Broadcasts an int to the team-shared array at index channel.
|
void |
buildRobot(RobotType type,
Direction dir)
Builds a robot of the given type in the given direction.
|
boolean |
canBuildRobot(RobotType type,
Direction dir)
Tests whether the robot can build a robot of the given type in the
given direction.
|
boolean |
canChop(int id)
Tests whether the robot can chop a tree with the given ID.
|
boolean |
canChop(MapLocation loc)
Tests whether the robot can chop a tree at the given location.
|
boolean |
canFirePentadShot()
Tests whether there is enough bullets in your bullet supply to
fire a pentad shot, the robot is of an appropriate type, and the
robot has not attacked in the current turn.
|
boolean |
canFireSingleShot()
Tests whether there are enough bullets in your bullet supply to
fire a single shot, the robot is of an appropriate type, and the
robot has not attacked in the current turn.
|
boolean |
canFireTriadShot()
Tests whether there are enough bullets in your bullet supply to
fire a triad shot, the robot is of an appropriate type, and the
robot has not attacked in the current turn.
|
boolean |
canHireGardener(Direction dir)
Tests whether the robot can hire a Gardener in the given direction.
|
boolean |
canInteractWithTree(int id)
Tests whether there is a tree with the given ID and, if so,
if the tree is within one stride of this robot and can therefore be
interacted with through chop(), shake(), or water().
|
boolean |
canInteractWithTree(MapLocation loc)
Tests whether there is a tree at the given location and, if so,
if the tree is within one stride of this robot and can therefore be
interacted with through chop(), shake(), or water().
|
boolean |
canMove(Direction dir)
Tells whether this robot can move one stride in the given direction,
without taking into account if they have already moved.
|
boolean |
canMove(Direction dir,
float distance)
Tests whether this robot can move
distance units in the given
direction, without taking into account if they have already moved. |
boolean |
canMove(MapLocation center)
Tests whether this robot can move to the target MapLocation.
|
boolean |
canPlantTree(Direction dir)
Tests whether the robot can build a bullet tree in the given direction.
|
boolean |
canSenseAllOfCircle(MapLocation center,
float radius)
Senses whether all of the given circle is within the robot's sensor range.
|
boolean |
canSenseBullet(int id)
Tests the given bullet exists and it is within this robot's
sensor range.
|
boolean |
canSenseBulletLocation(MapLocation loc)
Senses whether the given location is within the robot's bullet sense range.
|
boolean |
canSenseLocation(MapLocation loc)
Senses whether the given location is within the robot's sensor range.
|
boolean |
canSensePartOfCircle(MapLocation center,
float radius)
Senses whether any portion of the given circle is within the robot's sensor range.
|
boolean |
canSenseRadius(float radius)
Senses whether a point at the given radius is within the robot's sensor range.
|
boolean |
canSenseRobot(int id)
Tests whether the given robot exists and any part of the given robot is
within this robot's sensor range.
|
boolean |
canSenseTree(int id)
Tests whether the given tree exists and any part of the given tree is
within this robot's sensor range.
|
boolean |
canShake()
Tests whether this robot can shake a tree, taking into
account how many times this robot has shaken this turn.
|
boolean |
canShake(int id)
Tests whether this robot can shake a tree with the given ID.
|
boolean |
canShake(MapLocation loc)
Tests whether this robot can shake a tree at the given location.
|
boolean |
canStrike()
Tests whether a robot is able to strike this turn.
|
boolean |
canWater()
Tests whether this robot can water a tree, taking into
account how many times this robot has watered this turn and this
robot's type.
|
boolean |
canWater(int id)
Tests whether this robot can water a tree with the given ID.
|
boolean |
canWater(MapLocation loc)
Tests whether this robot can water a tree at the given location.
|
void |
chop(int id)
Chops the tree with the given ID.
|
void |
chop(MapLocation loc)
Chops the tree at the given location.
|
void |
disintegrate()
Kills your robot and ends the current round.
|
void |
donate(float bullets)
Donates the given amount of bullets to the reforestation fund in
exchange for one victory point per ten bullets donated.
|
void |
firePentadShot(Direction dir)
Fires a five bullets with the center bullet in the direction dir and
with a spread of
GameConstants.PENTAD_SPREAD_DEGREES degrees for the other
bullets. |
void |
fireSingleShot(Direction dir)
Fires a single bullet in the direction dir at the cost of
GameConstants.SINGLE_SHOT_COST from your team's bullet supply. |
void |
fireTriadShot(Direction dir)
Fires a three bullets with the center bullet in the direction dir and
with a spread of
GameConstants.TRIAD_SPREAD_DEGREES degrees for the other
bullets. |
int |
getAttackCount()
Returns the number of times the robot has attacked this turn.
|
int |
getBuildCooldownTurns()
Returns the number of cooldown turns remaining before this unit can build() again.
|
long |
getControlBits()
Gets this robot's 'control bits' for debugging purposes.
|
float |
getHealth()
Returns this robot's current health.
|
int |
getID()
Returns the ID of this robot.
|
MapLocation[] |
getInitialArchonLocations(Team t)
Returns a list of the INITIAL locations of the archons of a particular
team.
|
MapLocation |
getLocation()
Returns this robot's current location.
|
int |
getMoveCount()
Returns the number of times the robot has moved this turn.
|
int |
getOpponentVictoryPoints()
Returns your opponent's total victory points.
|
int |
getRobotCount()
Returns the number of robots on your team, including your archons.
|
int |
getRoundLimit()
Returns the number of rounds in the game.
|
int |
getRoundNum()
Returns the current round number, where round 0 is the first round of the
match.
|
Team |
getTeam()
Returns this robot's Team.
|
float |
getTeamBullets()
Returns the team's total bullet supply.
|
long[] |
getTeamMemory()
Returns the team memory from the last game of the match.
|
int |
getTeamVictoryPoints()
Returns the team's total victory points.
|
int |
getTreeCount()
Returns the number of trees on your team.
|
RobotType |
getType()
Returns this robot's type (SOLDIER, ARCHON, etc.).
|
float |
getVictoryPointCost()
Returns the current cost of a victory point in bullets.
|
boolean |
hasAttacked()
Returns whether the robot has attacked this turn.
|
boolean |
hasMoved()
Returns whether the robot has moved this turn.
|
boolean |
hasRobotBuildRequirements(RobotType type)
Tests whether you have the bullets and dependencies to build the given
robot, and this robot is a valid builder for the target robot.
|
boolean |
hasTreeBuildRequirements()
Tests whether you have the bullets and dependencies to build a
bullet tree, and this robot is a valid builder for a bullet tree.
|
void |
hireGardener(Direction dir)
Hires a Gardener in the given direction.
|
boolean |
isBuildReady()
Returns whether the robot's build cooldown has expired.
|
boolean |
isCircleOccupied(MapLocation center,
float radius)
Senses whether there is any robot or tree within a given circle.
|
boolean |
isCircleOccupiedExceptByThisRobot(MapLocation center,
float radius)
Senses whether there is any robot or tree within a given circle, ignoring this robot
if it itself occupies the circle.
|
boolean |
isLocationOccupied(MapLocation loc)
Senses whether there is a robot or tree at the given location.
|
boolean |
isLocationOccupiedByRobot(MapLocation loc)
Senses whether there is a robot at the given location.
|
boolean |
isLocationOccupiedByTree(MapLocation loc)
Senses whether there is a tree at the given location.
|
void |
move(Direction dir)
Moves one stride in the given direction.
|
void |
move(Direction dir,
float distance)
Moves distance in the given direction.
|
void |
move(MapLocation center)
Moves to the target MapLocation.
|
boolean |
onTheMap(MapLocation loc)
Senses whether a MapLocation is on the map.
|
boolean |
onTheMap(MapLocation center,
float radius)
Senses whether a given circle is completely on the map.
|
void |
plantTree(Direction dir)
Plants a bullet tree in the given direction.
|
int |
readBroadcast(int channel)
Retrieves the integer stored in the team-shared array at index channel.
|
boolean |
readBroadcastBoolean(int channel)
Retrieves the boolean stored in the team-shared array at index channel.
|
float |
readBroadcastFloat(int channel)
Retrieves the float stored in the team-shared array at index channel.
|
int |
readBroadcastInt(int channel)
Retrieves the int stored in the team-shared array at index channel.
|
void |
resign()
Causes your team to lose the game.
|
MapLocation[] |
senseBroadcastingRobotLocations()
Returns an array of all the locations of the robots that have
broadcasted in the last round (unconstrained by sensor range or distance).
|
BulletInfo |
senseBullet(int id)
Senses information about a particular bullet given its ID.
|
BulletInfo[] |
senseNearbyBullets()
Returns all bullets within bullet sense radius.
|
BulletInfo[] |
senseNearbyBullets(float radius)
Returns all bullets that can be sensed within a certain radius of this
robot.
|
BulletInfo[] |
senseNearbyBullets(MapLocation center,
float radius)
Returns all bullets that can be sensed within a certain
radius of a specified location.
|
RobotInfo[] |
senseNearbyRobots()
Returns all robots within sense radius.
|
RobotInfo[] |
senseNearbyRobots(float radius)
Returns all robots that can be sensed within a certain radius of this
robot.
|
RobotInfo[] |
senseNearbyRobots(float radius,
Team team)
Returns all robots of a given team that can be sensed within a certain
radius of this robot.
|
RobotInfo[] |
senseNearbyRobots(MapLocation center,
float radius,
Team team)
Returns all robots of a given team that can be sensed within a certain
radius of a specified location.
|
TreeInfo[] |
senseNearbyTrees()
Returns all trees within sense radius.
|
TreeInfo[] |
senseNearbyTrees(float radius)
Returns all trees that can be sensed within a certain radius of this
robot.
|
TreeInfo[] |
senseNearbyTrees(float radius,
Team team)
Returns all trees of a given team that can be sensed within a certain
radius of this robot.
|
TreeInfo[] |
senseNearbyTrees(MapLocation center,
float radius,
Team team)
Returns all trees of a given team that can be sensed within a certain
radius of a specified location.
|
RobotInfo |
senseRobot(int id)
Senses information about a particular robot given its ID.
|
RobotInfo |
senseRobotAtLocation(MapLocation loc)
Senses the robot at the given location, or null if there is no robot
there.
|
TreeInfo |
senseTree(int id)
Senses information about a particular tree given its ID.
|
TreeInfo |
senseTreeAtLocation(MapLocation loc)
Senses the tree at the given location, or null if there is no tree
there.
|
void |
setIndicatorDot(MapLocation loc,
int red,
int green,
int blue)
Draw a dot on the game map for debugging purposes.
|
void |
setIndicatorLine(MapLocation startLoc,
MapLocation endLoc,
int red,
int green,
int blue)
Draw a line on the game map for debugging purposes.
|
void |
setTeamMemory(int index,
long value)
Sets the team's "memory", which is saved for the next game in the match.
|
void |
setTeamMemory(int index,
long value,
long mask)
Sets this team's "memory".
|
void |
shake(int id)
Shakes the tree with the given ID for all the bullets held within
the tree; these bullets will be added to your team's bullet supply.
|
void |
shake(MapLocation loc)
Shakes the tree at the given location for all the bullets held within
the tree; these bullets will be added to your team's bullet supply.
|
void |
strike()
Strikes and deals damage to all other robots and trees within
GameConstants.LUMBERJACK_STRIKE_RADIUS of this robot. |
void |
water(int id)
Waters the target tree with the given ID, restoring
GameConstants.WATER_HEALTH_REGEN_RATE health to the tree. |
void |
water(MapLocation loc)
Waters the target tree at the given location, restoring
WATER_HEALTH_REGEN_RATE health to the tree. |
int getRoundLimit()
1int getRoundNum()
1float getTeamBullets()
1int getTeamVictoryPoints()
1int getOpponentVictoryPoints()
1int getRobotCount()
20int getTreeCount()
20MapLocation[] getInitialArchonLocations(Team t)
Team.NEUTRAL.t - the team for which you want to query the initial archon
locations. Will return an empty list if you query for Team.NEUTRAL100int getID()
1Team getTeam()
1RobotType getType()
1MapLocation getLocation()
1float getHealth()
1int getAttackCount()
1int getMoveCount()
1boolean onTheMap(MapLocation loc) throws GameActionException
loc - the location to checkGameActionException - if the location is not within sensor range.5boolean onTheMap(MapLocation center, float radius) throws GameActionException
center - the center of the circle to checkradius - the radius of the circle to checkGameActionException - if any portion of the given circle is not within sensor range.5boolean canSenseBulletLocation(MapLocation loc)
loc - the location to check5boolean canSenseLocation(MapLocation loc)
loc - the location to check5boolean canSenseRadius(float radius)
radius - the radius to check5boolean canSensePartOfCircle(MapLocation center, float radius)
center - the center of the circle to checkradius - the radius of the circle to check5boolean canSenseAllOfCircle(MapLocation center, float radius)
center - the center of the circle to checkradius - the radius of the circle to check5boolean isLocationOccupied(MapLocation loc) throws GameActionException
loc - the location to checkGameActionException - if the location is not within sensor range.20boolean isLocationOccupiedByTree(MapLocation loc) throws GameActionException
loc - the location to check.GameActionException - if the location is not within sensor range.20boolean isLocationOccupiedByRobot(MapLocation loc) throws GameActionException
loc - the location to checkGameActionException - if the location is not within sensor range.20boolean isCircleOccupied(MapLocation center, float radius) throws GameActionException
center - the center of the circle to checkradius - the radius of the circle to checkGameActionException - if any portion of the given circle is not within sensor range.20boolean isCircleOccupiedExceptByThisRobot(MapLocation center, float radius) throws GameActionException
center - the center of the circle to checkradius - the radius of the circle to checkGameActionException - if any portion of the given circle is not within sensor range.20TreeInfo senseTreeAtLocation(MapLocation loc) throws GameActionException
loc - the location to checkGameActionException - if the location is not within sensor range.20RobotInfo senseRobotAtLocation(MapLocation loc) throws GameActionException
loc - the location to checkGameActionException - if the location is not within sensor range.20boolean canSenseTree(int id)
id - the ID of the tree to query5boolean canSenseRobot(int id)
id - the ID of the robot to query5boolean canSenseBullet(int id)
id - the ID of the bullet to query5TreeInfo senseTree(int id) throws GameActionException
id - the ID of the tree to queryGameActionException - if the tree cannot be sensed (for example,
if it doesn't exist or is out of sight range).25RobotInfo senseRobot(int id) throws GameActionException
id - the ID of the robot to queryGameActionException - if the robot cannot be sensed (for example,
if it doesn't exist or is out of sight range).25BulletInfo senseBullet(int id) throws GameActionException
id - the ID of the bullet to queryGameActionException - if the bullet cannot be sensed (for example,
if it doesn't exist or is out of sight range).25RobotInfo[] senseNearbyRobots()
100RobotInfo[] senseNearbyRobots(float radius)
radius - return robots this distance away from the center of
this robot. If -1 is passed, all robots within sense radius are returned.100RobotInfo[] senseNearbyRobots(float radius, Team team)
radius - return robots this distance away from the center of
this robot. If -1 is passed, all robots within sense radius are returnedteam - filter game objects by the given team. If null is passed,
robots from any team are returned100RobotInfo[] senseNearbyRobots(MapLocation center, float radius, Team team)
center - center of the given search radiusradius - return robots this distance away from the given center
location. If -1 is passed, all robots within sense radius are returnedteam - filter game objects by the given team. If null is passed,
objects from all teams are returned100TreeInfo[] senseNearbyTrees()
100TreeInfo[] senseNearbyTrees(float radius)
radius - return trees this distance away from the center of
this robot. If -1 is passed, all trees within sense radius are returned100TreeInfo[] senseNearbyTrees(float radius, Team team)
radius - return trees this distance away from the center of
this robot. If -1 is passed, all trees within sense radius are returnedteam - filter game objects by the given team. If null is passed,
robots from any team are returned100TreeInfo[] senseNearbyTrees(MapLocation center, float radius, Team team)
center - center of the given search radiusradius - return trees this distance away from given center
location. If -1 is passed, all trees within sense radius are returnedteam - filter game objects by the given team. If null is passed,
objects from all teams are returned100BulletInfo[] senseNearbyBullets()
50BulletInfo[] senseNearbyBullets(float radius)
radius - return bullets this distance away from the center of
this robot. If -1 is passed, bullets from the whole map are returned50BulletInfo[] senseNearbyBullets(MapLocation center, float radius)
center - center of the given search radiusradius - return bullets this distance away from the given center
location. If -1 is passed, all bullets within bullet sense radius are returned50MapLocation[] senseBroadcastingRobotLocations()
100boolean hasMoved()
1boolean hasAttacked()
1boolean isBuildReady()
1int getBuildCooldownTurns()
1boolean canMove(Direction dir)
strideRadius.dir - the direction to move in10boolean canMove(Direction dir, float distance)
distance units in the given
direction, without taking into account if they have already moved. Takes into
account only the positions of trees, positions of other robots, and the
edge of the game map. Does not take into account whether this robot is
currently active. Note that one stride is equivalent to this robot's
strideRadius.dir - the direction to move indistance - the distance of a move you wish to check. Must be
in [0, RobotType.strideRadius]10boolean canMove(MapLocation center)
strideRadius, the location
is rescaled to be at the strideRadius. Takes into account only
the positions of trees, other robots, and the edge of the game map. Does
not take into account whether this robot is currently active.center - the MapLocation to move to10void move(Direction dir) throws GameActionException
strideRadius.dir - the direction to move inGameActionException - if the robot cannot move one stride in this
direction, such as already moved that turn, the target location being
off the map, and the target destination being occupied with either
another robot or a tree.0void move(Direction dir, float distance) throws GameActionException
strideRadius, it is rescaled to strideRadius.dir - the direction to move indistance - the distance to move in that directionGameActionException - if the robot cannot move distance in this
direction, such as already moved that turn, the target location being
off the map, and the target destination being occupied with either
another robot or a tree.0void move(MapLocation center) throws GameActionException
strideRadius, it is rescaled to be strideRadius away.center - the MapLocation to move to (or toward)GameActionException - if the robot can not move to the target MapLocation,
such as already having moved that turn, the target location being off the map,
or a target destination being occupied with either another robot or a tree.0boolean canStrike()
5void strike()
throws GameActionException
GameConstants.LUMBERJACK_STRIKE_RADIUS of this robot. Note that only Lumberjacks
can perform this function.GameActionException - if the robot is not of type LUMBERJACK or
cannot attack due to having already attacked that turn.0boolean canFireSingleShot()
5boolean canFireTriadShot()
5boolean canFirePentadShot()
5void fireSingleShot(Direction dir) throws GameActionException
GameConstants.SINGLE_SHOT_COST from your team's bullet supply. The speed
and damage of the bullet is determined from the type of this robot.dir - the direction you wish to fire the bulletGameActionException - if this robot is not of a type that can
fire single shots (ARCHON, GARDENER, etc.), cannot attack due to having
already attacked, or for having insufficient bullets in the bullet supply.0void fireTriadShot(Direction dir) throws GameActionException
GameConstants.TRIAD_SPREAD_DEGREES degrees for the other
bullets. This function costs GameConstants.TRIAD_SHOT_COST bullets from
your team's supply. The speed and damage of the bullets is determined
from the type of this robot.dir - the direction you wish to fire the center bulletGameActionException - if this robot is not of a type that can
fire triad shots (ARCHON, GARDENER, etc.), cannot attack due to having
already attacked, or for having insufficient bullets in the bullet supply.0void firePentadShot(Direction dir) throws GameActionException
GameConstants.PENTAD_SPREAD_DEGREES degrees for the other
bullets. This function costs GameConstants.PENTAD_SHOT_COST bullets from
your team's supply. The speed and damage of the bullets is determined
from the type of this robot.dir - the direction you wish to fire the center bulletGameActionException - if this robot is not of a type that can
fire pentad shots (ARCHON, GARDENER, etc.), cannot attack due to having
already attacked, or for having insufficient bullets in the bullet supply.0boolean canChop(MapLocation loc)
GameConstants.INTERACTION_DIST_FROM_EDGE,
the robot's type, if a tree exists, and if the robot hasn't attacked this turn.loc - The location of the tree to chop5boolean canChop(int id)
GameConstants.INTERACTION_DIST_FROM_EDGE, the robot's type,
if a tree exists, and if the robot hasn't attacked this turn.id - The ID of the tree to chop5void chop(MapLocation loc) throws GameActionException
loc - the location of the tree to chopGameActionException - if the given location does not contain
a tree, the specified tree is not within GameConstants.INTERACTION_DIST_FROM_EDGE
of this robot, this robot is not of type LUMBERJACK, or this robot has already attacked
this turn.0void chop(int id) throws GameActionException
id - the ID of the tree you wish to chopGameActionException - if there isn't a tree with the given id,
the specified tree is not within one stride of this robot, this robot
is not of type LUMBERJACK, or this robot has already attacked this turn.0boolean canShake(MapLocation loc)
GameConstants.INTERACTION_DIST_FROM_EDGE,
if a tree exists, and if the robot hasn't shaken this turn.loc - The location of the tree to shake5boolean canShake(int id)
GameConstants.INTERACTION_DIST_FROM_EDGE,
if a tree exists, and if the robot hasn't shaken this turn.id - The ID of the tree to shake5void shake(MapLocation loc) throws GameActionException
loc - the location of the tree to shakeGameActionException - if the given location does not contain
a tree, if the tree (not location) is not within GameConstants.INTERACTION_DIST_FROM_EDGE
of this robot, or if this robot has already shaken a tree this turn.0void shake(int id)
throws GameActionException
id - the ID of the tree to shakeGameActionException - if there isn't a tree with the given id,
if the tree (not location) is not within one stride of this robot,
or if this robot has already shaken a tree this turn0boolean canWater(MapLocation loc)
loc - The location of the tree to water5boolean canWater(int id)
GameConstants.INTERACTION_DIST_FROM_EDGE, the robot's type, if a tree exists, and
if the robot hasn't watered this turn.id - The ID of a tree to check.5void water(MapLocation loc) throws GameActionException
WATER_HEALTH_REGEN_RATE health to the tree.
Robots can only water once per turn and only with robots
of type GARDENER.loc - the location of the tree you wish to waterGameActionException - if the given location does not contain
a tree, the tree is not within GameConstants.INTERACTION_DIST_FROM_EDGE of this robot,
this robot is not of type GARDENER, or this robot has already
watered a tree.0void water(int id)
throws GameActionException
GameConstants.WATER_HEALTH_REGEN_RATE health to the tree.
Robots can only water once per turn and only with robots
of type GARDENER.id - the ID of the tree you wish to water.GameActionException - if there isn't a tree with the given id,
the tree is not within GameConstants.INTERACTION_DIST_FROM_EDGE of this robot,
this robot is not of type GARDENER, or this robot has already
watered a tree.0boolean canWater()
5boolean canShake()
5boolean canInteractWithTree(MapLocation loc)
loc - the location you wish to testGameConstants.INTERACTION_DIST_FROM_EDGE of this robot.5boolean canInteractWithTree(int id)
id - the ID of the tree you wish to testGameConstants.INTERACTION_DIST_FROM_EDGE of this robot.5void broadcast(int channel,
int data)
throws GameActionException
channel - the index to write to, from 0 to BROADCAST_MAX_CHANNELSdata - one int of data to writeGameActionException - if the channel is invalidbroadcastInt(int channel, int data)10int readBroadcast(int channel)
throws GameActionException
channel - the index to query, from 0 to BROADCAST_MAX_CHANNELSGameActionException - if the channel is invalidreadBroadcastInt(int channel)5void broadcastBoolean(int channel,
boolean data)
throws GameActionException
channel - the index to write to, from 0 to BROADCAST_MAX_CHANNELSdata - one int of data to writeGameActionException - if the channel is invalid10boolean readBroadcastBoolean(int channel)
throws GameActionException
channel - the index to query, from 0 to BROADCAST_MAX_CHANNELSGameActionException - if the channel is invalid5void broadcastInt(int channel,
int data)
throws GameActionException
channel - the index to write to, from 0 to BROADCAST_MAX_CHANNELSdata - one int of data to writeGameActionException - if the channel is invalidbroadcast(int channel, int data)10int readBroadcastInt(int channel)
throws GameActionException
channel - the index to query, from 0 to BROADCAST_MAX_CHANNELSGameActionException - if the channel is invalidreadBroadcast(int channel)5void broadcastFloat(int channel,
float data)
throws GameActionException
channel - the index to write to, from 0 to BROADCAST_MAX_CHANNELSdata - one float of data to writeGameActionException - if the channel is invalid10float readBroadcastFloat(int channel)
throws GameActionException
channel - the index to query, from 0 to BROADCAST_MAX_CHANNELSGameActionException - if the channel is invalid5boolean hasRobotBuildRequirements(RobotType type)
type - the type of robot to build5boolean hasTreeBuildRequirements()
5boolean canBuildRobot(RobotType type, Direction dir)
dir - the direction to build intype - the type of robot to build10void buildRobot(RobotType type, Direction dir) throws GameActionException
dir - the direction to spawn the unittype - the type of robot to buildGameActionException - if you don't have enough bullets, if
the robot is still in build cooldown, if the direction is not a
good build direction, or if this robot is not of an appropriate type.0boolean canPlantTree(Direction dir)
dir - the direction to build in10void plantTree(Direction dir) throws GameActionException
dir - the direction to plant the bullet treeGameActionException - if you don't have enough bullets, if
the robot is still in build cooldown, if the direction is not a good build
direction, or if this robot is not of an appropriate type.0boolean canHireGardener(Direction dir)
dir - the direction to build in10void hireGardener(Direction dir) throws GameActionException
dir - the direction to spawn the GardenerGameActionException - if you don't have enough bullets, if
the robot is still in build cooldown, if the direction is not a good build
direction, or if this robot is not of an appropriate type.0float getVictoryPointCost()
GameConstants.VP_BASE_COST +
NumRounds * GameConstants.VP_INCREASE_PER_ROUND.0void donate(float bullets)
throws GameActionException
bullets - the amount of bullets you wish to donateGameActionException - if you have less bullets in your bullet
supply than the amount of bullet you wish to donate.0void disintegrate()
0void resign()
0void setIndicatorDot(MapLocation loc, int red, int green, int blue)
loc - the location to draw the dot.red - the red component of the dot's color.green - the green component of the dot's color.blue - the blue component of the dot's color.0void setIndicatorLine(MapLocation startLoc, MapLocation endLoc, int red, int green, int blue)
startLoc - the location to draw the line from.endLoc - the location to draw the line to.red - the red component of the line's color.green - the green component of the line's color.blue - the blue component of the line's color.0void setTeamMemory(int index,
long value)
GameConstants.TEAM_MEMORY_LENGTH longs.
If this method is called more than once with the same index in the same
game, the last call is what is saved for the next game.index - the index of the array to setvalue - the data that the team should remember for the next gamejava.lang.ArrayIndexOutOfBoundsException - if index is less
than zero or greater than or equal to
GameConstants.TEAM_MEMORY_LENGTH.getTeamMemory(),
setTeamMemory(int, long, long)0void setTeamMemory(int index,
long value,
long mask)
setTeamMemory(int, long) provides. For example, if
mask == 0xFF then only the eight least significant bits of the
memory will be set.index - the index of the array to setvalue - the data that the team should remember for the next gamemask - indicates which bits should be setjava.lang.ArrayIndexOutOfBoundsException - if index is less
than zero or greater than or equal to
GameConstants.TEAM_MEMORY_LENGTH.getTeamMemory(),
setTeamMemory(int, long)0long[] getTeamMemory()
GameConstants.TEAM_MEMORY_LENGTH. If
setTeamMemory was not called in the last game, or there was no last game,
the corresponding long defaults to 0.setTeamMemory(int, long),
setTeamMemory(int, long, long)0long getControlBits()
0