#include <RoboSim.hpp>

Classes | |
| class | RoboAPIImplementor |
| class | SimGridAllyDeterminant |
Public Member Functions | |
| vector< vector< GridCell > > & | getWorldGrid () |
| int | getOccupantPlayer (const GridCell &cell) const |
| RoboSim (int initial_robots_per_combatant, int skill_points, int length, int width, int obstacles) | |
| int | executeSingleTimeStep () |
Private Member Functions | |
| vector< vector< GridCell > > | getSanitizedSubGrid (int x_left, int y_up, int x_right, int y_down, int player) const |
Static Private Member Functions | |
| static Robot_Specs | checkSpecsValid (Robot_Specs proposed, int player, int skill_points) |
Private Attributes | |
| vector< vector< GridCell > > | worldGrid |
| vector< RobotData > | turnOrder |
| int | turnOrder_pos |
Static Private Attributes | |
| static const int | WALL_HEALTH = 10 |
| static const int | WALL_DEFENSE = 10 |
Definition at line 21 of file RoboSim.hpp.
| RoboSim::RoboSim | ( | int | initial_robots_per_combatant, |
| int | skill_points, | ||
| int | length, | ||
| int | width, | ||
| int | obstacles | ||
| ) |
Constructor for RoboSim:
| initial_robots_per_combatant | how many robots each team starts out with |
| skill_points | skill points per combatant |
| length | length of arena |
| width | width of arena |
| obstacles | number of obstacles on battlefield |
Definition at line 66 of file RoboSim.cpp.
References robot_api::RobotData::assoc_cell, robot_api::Robot_Specs::charge, robot_api::Robot_Status::charge, checkSpecsValid(), Robot::createRobot(), robot_api::Robot_Status::defense_boost, robot_api::EMPTY, robot_api::Robot_Status::health, robot_api::RobotData::invested_assoc_cell, robot_api::RobotData::investedPower, robot_api::NOTHING, robot_api::RobotData::player, RBP_CALL_CONSTRUCTOR, RBP_NUM_PLAYERS, robot_api::RobotData::robot, robot_api::SELF, robot_api::RobotData::specs, robot_api::RobotData::status, turnOrder, turnOrder_pos, robot_api::WALL, WALL_HEALTH, robot_api::RobotData::whatBuilding, and worldGrid.

|
staticprivate |
Definition at line 58 of file RoboSim.cpp.
References robot_api::Robot_Specs::attack, robot_api::Robot_Specs::charge, robot_api::Robot_Specs::defense, and robot_api::Robot_Specs::power.
Referenced by RoboSim::RoboAPIImplementor::finalizeBuilding(), and RoboSim().

|
inline |
Executes one timestep of the simulation.
Definition at line 332 of file RoboSim.hpp.
References Robot::act(), robot_api::RobotData::buffered_radio, robot_api::Robot_Specs::charge, robot_api::Robot_Status::charge, robot_api::Robot_Status::defense_boost, robot_api::Robot_Specs::power, robot_api::Robot_Status::power, robot_api::RobotData::robot, robot_api::RobotData::specs, and robot_api::RobotData::status.

|
inline |
SimulatorGUI needs to see who owns the robots in the cells This is a hack to allow this by downcasting the passed GridCell to SimGridCell and extracting the data.
Definition at line 54 of file RoboSim.hpp.
References robot_api::GridCell::occupant_data, and robot_api::RobotData::player.
Referenced by SimulatorGUI::do_timestep().

|
private |
Helper method to retrieve a sanitized subgrid of the world grid
| x_left | left x coordinate (inclusive) |
| y_up | smaller y coordinate (inclusive) |
| x_right | right x coordinate (inclusive) |
| y_down | larger y coordinate (inclusive) |
| player | player number |
Definition at line 34 of file RoboSim.cpp.
References robot_api::ALLY, robot_api::GridCell::contents, robot_api::ENEMY, robot_api::GridCell::has_private_members, robot_api::GridCell::occupant_data, robot_api::RobotData::player, robot_api::SELF, and robot_api::GridCell::wallforthealth.
Referenced by RoboSim::RoboAPIImplementor::getVisibleNeighborhood(), and RoboSim::RoboAPIImplementor::getWorld().

|
inline |
This is so SimulatorGUI can get a copy of world
Definition at line 49 of file RoboSim.hpp.
Referenced by SimulatorGUI::do_timestep().

|
private |
Definition at line 44 of file RoboSim.hpp.
Referenced by RoboSim::RoboAPIImplementor::processAttack(), RoboSim(), and RoboSim::RoboAPIImplementor::sendMessage().
|
private |
Definition at line 45 of file RoboSim.hpp.
Referenced by RoboSim::RoboAPIImplementor::processAttack(), and RoboSim().
|
staticprivate |
Definition at line 40 of file RoboSim.hpp.
|
staticprivate |
Definition at line 39 of file RoboSim.hpp.
Referenced by RoboSim::RoboAPIImplementor::finalizeBuilding(), and RoboSim().
|
private |
Definition at line 43 of file RoboSim.hpp.
Referenced by RoboSim::RoboAPIImplementor::charge(), RoboSim::RoboAPIImplementor::getVisibleNeighborhood(), RoboSim::RoboAPIImplementor::getWorld(), RoboSim(), RoboSim::RoboAPIImplementor::scanEnemy(), and RoboSim::RoboAPIImplementor::sendMessage().