Public Member Functions | |
Robot.AttackResult | meleeAttack (int power, Robot.GridCell adjacent_cell) throws RoboSim.RoboSimExecutionException |
Robot.AttackResult | rangedAttack (int power, Robot.GridCell nonadjacent_cell) throws RoboSim.RoboSimExecutionException |
Robot.AttackResult | capsuleAttack (int power_of_capsule, Robot.GridCell cell) throws RoboSim.RoboSimExecutionException |
void | defend (int power) throws RoboSim.RoboSimExecutionException |
void | move (int steps, Robot.Direction way) throws RoboSim.RoboSimExecutionException |
void | pick_up_capsule (Robot.GridCell adjacent_cell) throws RoboSim.RoboSimExecutionException |
void | drop_capsule (Robot.GridCell adjacent_cell, int power_of_capsule) throws RoboSim.RoboSimExecutionException |
Robot.BuildStatus | getBuildStatus () throws RoboSim.RoboSimExecutionException |
Robot.GridCell | getBuildTarget () throws RoboSim.RoboSimExecutionException |
int | getInvestedBuildPower () throws RoboSim.RoboSimExecutionException |
void | setBuildTarget (Robot.BuildStatus status, Robot.GridCell location) throws RoboSim.RoboSimExecutionException |
void | setBuildTarget (Robot.BuildStatus status, Robot.GridCell location, byte[] creation_message) throws RoboSim.RoboSimExecutionException |
void | build (int power) throws RoboSim.RoboSimExecutionException |
void | repair (int power) throws RoboSim.RoboSimExecutionException |
void | charge (int power, Robot.GridCell ally) throws RoboSim.RoboSimExecutionException |
void | sendMessage (byte[] message, int power) throws RoboSim.RoboSimExecutionException |
Robot.GridCell[][] | getVisibleNeighborhood () |
Robot.GridCell[][] | getWorld (int power) throws RoboSim.RoboSimExecutionException |
void | scanEnemy (Robot.Robot_Specs enemySpecs, Robot.Robot_Status enemyStatus, Robot.GridCell toScan) throws RoboSim.RoboSimExecutionException |
WorldAPI Interface:
Provides callbacks into Simulator so your Robot can take actions in the virtual world.
The underlying class type is an inner class defined inside the simulator which is opaque to your robot.
Definition at line 8 of file WorldAPI.java.
void WorldAPI.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. |
Implemented in RoboSim.RoboAPIImplementor.
Robot.AttackResult WorldAPI.capsuleAttack | ( | int | power_of_capsule, |
Robot.GridCell | cell | ||
) | throws RoboSim.RoboSimExecutionException |
Capsule attack: attack with a capsule
power_of_capsule | power of the capsule to use in the attack |
cell | GridCell (may be adjacent or nonadjacent) to attack |
Implemented in RoboSim.RoboAPIImplementor.
void WorldAPI.charge | ( | int | power, |
Robot.GridCell | ally | ||
) | throws RoboSim.RoboSimExecutionException |
Spend power to charge an adjacent ally robot. 1-for-1 efficiency.
power | amount of power to use for charging ally |
ally | cell containing ally to charge. Must be adjacent. |
Implemented in RoboSim.RoboAPIImplementor.
void WorldAPI.defend | ( | int | power | ) | throws RoboSim.RoboSimExecutionException |
Defend: increase defense
power | power to use for defense (may not exceed defense skill) |
Implemented in RoboSim.RoboAPIImplementor.
void WorldAPI.drop_capsule | ( | Robot.GridCell | adjacent_cell, |
int | power_of_capsule | ||
) | throws RoboSim.RoboSimExecutionException |
drop_capsule: drop a capsule (for an ally to pick up, presumably)
adjacent_cell | where to drop capsule (must be adjacent) |
power_of_capsule | how powerful a capsule to drop |
Implemented in RoboSim.RoboAPIImplementor.
Robot.BuildStatus WorldAPI.getBuildStatus | ( | ) | throws RoboSim.RoboSimExecutionException |
Tells us what we're in the middle of building.
Implemented in RoboSim.RoboAPIImplementor.
Robot.GridCell WorldAPI.getBuildTarget | ( | ) | throws RoboSim.RoboSimExecutionException |
Implemented in RoboSim.RoboAPIImplementor.
int WorldAPI.getInvestedBuildPower | ( | ) | throws RoboSim.RoboSimExecutionException |
Implemented in RoboSim.RoboAPIImplementor.
Robot.GridCell [][] WorldAPI.getVisibleNeighborhood | ( | ) |
Gets a copy of the portion of the world visible to the robot. Range is equal to defense skill. Does not cost any power.
Implemented in RoboSim.RoboAPIImplementor.
Referenced by ManualBot.act().
Robot.GridCell [][] WorldAPI.getWorld | ( | int | power | ) | throws RoboSim.RoboSimExecutionException |
Gets a copy of the entire world. Takes 3 power, plus additional if jamming is taking place (which won't be; jamming is not implemented).
power | to spend attempting to get the world |
Implemented in RoboSim.RoboAPIImplementor.
Robot.AttackResult WorldAPI.meleeAttack | ( | int | power, |
Robot.GridCell | adjacent_cell | ||
) | throws RoboSim.RoboSimExecutionException |
Melee attack: attack an adjacent grid cell
power | Power to use for attack (may not exceed attack skill) |
adjacent_cell | Adjacent GridCell to attack |
Implemented in RoboSim.RoboAPIImplementor.
Referenced by ManualBot.act().
void WorldAPI.move | ( | int | steps, |
Robot.Direction | way | ||
) | throws RoboSim.RoboSimExecutionException |
move: move robot
steps | how far to move |
way | which way to move |
Implemented in RoboSim.RoboAPIImplementor.
Referenced by ManualBot.act().
void WorldAPI.pick_up_capsule | ( | Robot.GridCell | adjacent_cell | ) | throws RoboSim.RoboSimExecutionException |
pick_up_capsule: pick up a capsule
adjacent_cell | GridCell where capsule is that you want to pick up (must be adjacent) |
Implemented in RoboSim.RoboAPIImplementor.
Robot.AttackResult WorldAPI.rangedAttack | ( | int | power, |
Robot.GridCell | nonadjacent_cell | ||
) | throws RoboSim.RoboSimExecutionException |
Ranged attack: attack nonadjacent grid cell within certain range
power | Power to use for attack (may not exceed attack skill) |
nonadjacent_cell | non-adjacent GridCell to attack |
Implemented in RoboSim.RoboAPIImplementor.
Referenced by ManualBot.act().
void WorldAPI.repair | ( | int | power | ) | throws RoboSim.RoboSimExecutionException |
Spend power to repair yourself. 2 power restores 1 health.
power | amount of power to spend on repairs. Should be even. |
Implemented in RoboSim.RoboAPIImplementor.
void WorldAPI.scanEnemy | ( | Robot.Robot_Specs | enemySpecs, |
Robot.Robot_Status | enemyStatus, | ||
Robot.GridCell | toScan | ||
) | throws RoboSim.RoboSimExecutionException |
Scans an enemy (or ally), retrieving information about the robot. The cell scanned must be visible (within defense cells from us).
Takes 1 power.
enemySpecs | empty Robot_Specs object to be filled in |
enemyStatus | empty Robot_Status object to be filled in |
toScan | cell containing robot we want to scan |
Implemented in RoboSim.RoboAPIImplementor.
void WorldAPI.sendMessage | ( | byte[] | message, |
int | power | ||
) | throws RoboSim.RoboSimExecutionException |
Spend additional power to get radio messages unavailable because of jamming.
power | amount of power to spend to attempt to overcome jamming |
message | 64-byte array containing message to transmit |
power | amount of power to use for sending message |
Implemented in RoboSim.RoboAPIImplementor.
void WorldAPI.setBuildTarget | ( | Robot.BuildStatus | status, |
Robot.GridCell | location | ||
) | throws RoboSim.RoboSimExecutionException |
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. This will destroy any in-progress build.
Note that you must not move from your current cell while in the process of building anything other than a capsule. If you do, you will lose any in-progress work on a wall or fort, and a robot will be automatically finalized with however many skill points you've invested up to that point.
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. |
Implemented in RoboSim.RoboAPIImplementor.
void WorldAPI.setBuildTarget | ( | Robot.BuildStatus | status, |
Robot.GridCell | location, | ||
byte[] | creation_message | ||
) | throws RoboSim.RoboSimExecutionException |
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. This will destroy any in-progress build.
Note that you must not move from your current cell while in the process of building anything other than a capsule. If you do, you will lose any in-progress work on a wall or fort, and a robot will be automatically finalized with however many skill points you've invested up to that point.
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) |
Implemented in RoboSim.RoboAPIImplementor.