#include <DemoBot.hpp>
Public Member Functions | |
Robot_Specs | createRobot (WorldAPI *api, int skill_points, vector< uint8_t > message) |
virtual Robot_Specs | createRobot (WorldAPI *api, int skill_points, std::vector< std::uint8_t > message)=0 |
virtual void | act (WorldAPI &api, Robot_Status status, std::vector< std::vector< std::uint8_t > > received_radio)=0 |
Private Member Functions | |
void | act (WorldAPI &api, Robot_Status status, vector< vector< uint8_t >> received_radio) |
Static Private Member Functions | |
static bool | isAdjacent (const GridCell &c1, const GridCell &c2) |
static int | searchAndDestroy (GridCell &self, vector< vector< GridCell >> neighbors, WorldAPI &api, int remaining_power) |
Private Attributes | |
Robot_Specs | my_specs |
DemoBot: Demo Robot implementation for OffenseBot
Definition at line 12 of file DemoBot.hpp.
|
pure virtualinherited |
Each turn, this method is called to allow your robot to act.
api | a reference to a WorldAPI object you can use to interact with the simulator. |
status | a Robot_Status object containing information about your current health and energy level |
received_radio | the radio signals you have received this round. Each message is exactly 64 bytes long. You may be able to receive additional radio signals by calling getMessages() with a nonzero power if you are being jammed. |
Referenced by RoboSim::executeSingleTimeStep().
|
inlineprivate |
Definition at line 97 of file DemoBot.hpp.
References robot_api::Robot_Status::charge, WorldAPI::getVisibleNeighborhood(), WorldAPI::getWorld(), robot_api::RoboSimExecutionException::msg, robot_api::Robot_Status::power, and robot_api::SELF.
|
inline |
Definition at line 18 of file DemoBot.hpp.
References robot_api::Robot_Specs::attack, robot_api::Robot_Specs::charge, robot_api::Robot_Specs::defense, and robot_api::Robot_Specs::power.
|
pure virtualinherited |
Entry point for your robot on its creation
api | a pointer to a WorldAPI object you can use to interact with the simulator, if it's not NULL (currently unused and always NULL) |
skill_points | the number of skill points your robot is allowed to have. |
message | a 64-byte message from the robot who created you. If you were created by the simulator, the first two bytes of the message will contain your ID, which is unique among the IDs of all your team's robots created by the world. Otherwise, the format of the message is unspecified: it's up to you to define it. |
Referenced by RoboSim::RoboAPIImplementor::finalizeBuilding(), and RoboSim::RoboSim().
Definition at line 50 of file DemoBot.hpp.
References robot_api::GridCell::x_coord, and robot_api::GridCell::y_coord.
|
inlinestaticprivate |
Definition at line 58 of file DemoBot.hpp.
References robot_api::DOWN, robot_api::ENEMY, robot_api::RobotUtility::findShortestPath(), robot_api::LEFT, WorldAPI::meleeAttack(), WorldAPI::move(), robot_api::RIGHT, and robot_api::UP.
|
private |
Definition at line 15 of file DemoBot.hpp.