public interface WorldAPI
| Modifier and Type | Method and Description |
|---|---|
void |
build(int power) |
Robot.AttackResult |
capsuleAttack(int power_of_capsule,
Robot.GridCell cell)
Capsule attack: attack with a capsule
|
void |
charge(int power,
Robot.GridCell ally)
Spend power to charge an adjacent ally robot.
|
void |
defend(int power)
Defend: increase defense
|
void |
drop_capsule(Robot.GridCell adjacent_cell,
int power_of_capsule)
drop_capsule: drop a capsule (for an ally to pick up, presumably)
|
Robot.BuildStatus |
getBuildStatus()
Tells us what we're in the middle of building.
|
Robot.GridCell |
getBuildTarget() |
int |
getInvestedBuildPower() |
Robot.GridCell[][] |
getVisibleNeighborhood()
Gets a copy of the portion of the world visible to the robot.
|
Robot.GridCell[][] |
getWorld(int power)
Gets a copy of the entire world.
|
Robot.AttackResult |
meleeAttack(int power,
Robot.GridCell adjacent_cell)
Melee attack: attack an adjacent grid cell
|
void |
move(int steps,
Robot.Direction way)
move: move robot
|
void |
pick_up_capsule(Robot.GridCell adjacent_cell)
pick_up_capsule: pick up a capsule
|
Robot.AttackResult |
rangedAttack(int power,
Robot.GridCell nonadjacent_cell)
Ranged attack: attack nonadjacent grid cell within certain range
|
void |
repair(int power)
Spend power to repair yourself.
|
void |
scanEnemy(Robot.Robot_Specs enemySpecs,
Robot.Robot_Status enemyStatus,
Robot.GridCell toScan)
Scans an enemy (or ally), retrieving information about the robot.
|
void |
sendMessage(byte[] message,
int power)
Sends a message to an ally or allies.
|
void |
setBuildTarget(Robot.BuildStatus status,
Robot.GridCell location)
Tells the simulator the robot is beginning to build something in an
adjacent cell (or, for capsules, inside itself).
In order to mark a capsule or robot as "done", call this method with both parameters null. |
void |
setBuildTarget(Robot.BuildStatus status,
Robot.GridCell location,
byte[] creation_message)
Tells the simulator the robot is beginning to build something in an
adjacent cell (or, for capsules, inside itself).
In order to mark a capsule or robot as "done", call this method with both parameters null. |
Robot.AttackResult meleeAttack(int power, Robot.GridCell adjacent_cell) throws RoboSim.RoboSimExecutionException
power - Power to use for attack (may not exceed attack skill)adjacent_cell - Adjacent GridCell to attackRoboSim.RoboSimExecutionExceptionRobot.AttackResult rangedAttack(int power, Robot.GridCell nonadjacent_cell) throws RoboSim.RoboSimExecutionException
power - Power to use for attack (may not exceed attack skill)nonadjacent_cell - non-adjacent GridCell to attackRoboSim.RoboSimExecutionExceptionRobot.AttackResult capsuleAttack(int power_of_capsule, Robot.GridCell cell) throws RoboSim.RoboSimExecutionException
power_of_capsule - power of the capsule to use in the attackcell - GridCell (may be adjacent or nonadjacent) to attackRoboSim.RoboSimExecutionExceptionvoid defend(int power)
throws RoboSim.RoboSimExecutionException
power - power to use for defense (may not exceed defense skill)RoboSim.RoboSimExecutionExceptionvoid move(int steps,
Robot.Direction way)
throws RoboSim.RoboSimExecutionException
steps - how far to moveway - which way to moveRoboSim.RoboSimExecutionExceptionvoid pick_up_capsule(Robot.GridCell adjacent_cell) throws RoboSim.RoboSimExecutionException
adjacent_cell - GridCell where capsule is that you want to pick
up (must be adjacent)RoboSim.RoboSimExecutionExceptionvoid drop_capsule(Robot.GridCell adjacent_cell, int power_of_capsule) throws RoboSim.RoboSimExecutionException
adjacent_cell - where to drop capsule (must be adjacent)power_of_capsule - how powerful a capsule to dropRoboSim.RoboSimExecutionExceptionRobot.BuildStatus getBuildStatus() throws RoboSim.RoboSimExecutionException
RoboSim.RoboSimExecutionExceptionRobot.GridCell getBuildTarget() throws RoboSim.RoboSimExecutionException
RoboSim.RoboSimExecutionExceptionint getInvestedBuildPower()
throws RoboSim.RoboSimExecutionException
RoboSim.RoboSimExecutionExceptionvoid setBuildTarget(Robot.BuildStatus status, Robot.GridCell location) throws RoboSim.RoboSimExecutionException
status - what we're going to start building (or, in the case of
an energy capsule, resume building)location - where to direct our building efforts. Must be an
adjacent, empty location, or null if status=capsule.RoboSim.RoboSimExecutionExceptionvoid setBuildTarget(Robot.BuildStatus status, Robot.GridCell location, byte[] creation_message) throws RoboSim.RoboSimExecutionException
status - what we're going to start building (or, in the case of
an energy capsule, resume building)location - where to direct our building efforts. Must be an
adjacent, empty location, or null if status=capsule.creation_message - message to send to newly created robot
(if we're finalizing one)RoboSim.RoboSimExecutionExceptionvoid build(int power)
throws RoboSim.RoboSimExecutionException
power - how much power to apply to building the current target.
Must not be more than remaining power needed to finish
building target.RoboSim.RoboSimExecutionExceptionvoid repair(int power)
throws RoboSim.RoboSimExecutionException
power - amount of power to spend on repairs. Should be even.RoboSim.RoboSimExecutionExceptionvoid charge(int power,
Robot.GridCell ally)
throws RoboSim.RoboSimExecutionException
power - amount of power to use for charging allyally - cell containing ally to charge. Must be adjacent.RoboSim.RoboSimExecutionExceptionvoid sendMessage(byte[] message,
int power)
throws RoboSim.RoboSimExecutionException
message - 64-byte array containing message to transmitpower - amount of power to use for sending messageRoboSim.RoboSimExecutionExceptionRobot.GridCell[][] getVisibleNeighborhood()
Robot.GridCell[][] getWorld(int power) throws RoboSim.RoboSimExecutionException
power - to spend attempting to get the worldRoboSim.RoboSimExecutionExceptionvoid scanEnemy(Robot.Robot_Specs enemySpecs, Robot.Robot_Status enemyStatus, Robot.GridCell toScan) throws RoboSim.RoboSimExecutionException
enemySpecs - empty Robot_Specs object to be filled inenemyStatus - empty Robot_Status object to be filled intoScan - cell containing robot we want to scanRoboSim.RoboSimExecutionException