#include <WorldAPI.hpp>
Public Member Functions | |
virtual AttackResult | meleeAttack (int power, GridCell &adjacent_cell)=0 |
virtual AttackResult | rangedAttack (int power, GridCell &nonadjacent_cell)=0 |
virtual AttackResult | capsuleAttack (int power_of_capsule, GridCell &cell)=0 |
virtual void | defend (int power)=0 |
virtual void | move (int steps, Direction way)=0 |
virtual void | pick_up_capsule (GridCell &adjacent_cell)=0 |
virtual void | drop_capsule (GridCell &adjacent_cell, int power_of_capsule)=0 |
virtual BuildStatus | getBuildStatus ()=0 |
virtual GridCell * | getBuildTarget ()=0 |
virtual int | getInvestedBuildPower ()=0 |
virtual void | setBuildTarget (BuildStatus status, GridCell *location)=0 |
virtual void | setBuildTarget (BuildStatus status, GridCell *location, vector< uint8_t > message)=0 |
virtual void | build (int power)=0 |
virtual void | repair (int power)=0 |
virtual void | charge (int power, GridCell &ally)=0 |
virtual void | sendMessage (vector< uint8_t > message, int power)=0 |
virtual vector< vector< GridCell > > | getVisibleNeighborhood ()=0 |
virtual vector< vector< GridCell > > | getWorld (int power)=0 |
virtual void | scanEnemy (Robot_Specs &enemySpecs, Robot_Status &enemyStatus, GridCell toScan)=0 |
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 12 of file WorldAPI.hpp.
|
pure virtual |
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.
|
pure virtual |
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.
|
pure virtual |
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.
|
pure virtual |
Defend: increase defense
power | power to use for defense (may not exceed defense skill) |
Implemented in RoboSim::RoboAPIImplementor.
Referenced by DefenderBot::act().
|
pure virtual |
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.
|
pure virtual |
Tells us what we're in the middle of building.
Implemented in RoboSim::RoboAPIImplementor.
|
pure virtual |
Implemented in RoboSim::RoboAPIImplementor.
|
pure virtual |
Implemented in RoboSim::RoboAPIImplementor.
|
pure virtual |
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 DemoBot::act().
|
pure virtual |
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.
Referenced by DemoBot::act().
|
pure virtual |
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 DemoBot::searchAndDestroy().
|
pure virtual |
move: move robot
steps | how far to move |
way | which way to move |
Implemented in RoboSim::RoboAPIImplementor.
Referenced by DemoBot::searchAndDestroy().
|
pure virtual |
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.
|
pure virtual |
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.
|
pure virtual |
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.
Referenced by DefenderBot::act().
|
pure virtual |
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.
|
pure virtual |
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.
|
pure virtual |
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.
|
pure virtual |
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.