Classes | |
class | RoboAPIImplementor |
class | RoboSimExecutionException |
class | RobotData |
class | SimGridAllyDeterminant |
class | SimGridCell |
Public Member Functions | |
Robot.GridCell[][] | getWorldGrid () |
String | getOccupantPlayer (Robot.GridCell to_convert) |
RoboSim (String[] combatants, int initial_robots_per_combatant, int skill_points, int length, int width, int obstacles) throws RoboSimExecutionException | |
String | executeSingleTimeStep () throws RoboSimExecutionException |
Private Member Functions | |
SimGridCell[][] | getSubGrid (int x_left, int y_up, int x_right, int y_down) |
Static Private Member Functions | |
static Robot.GridCell[][] | sanitizeGrid (SimGridCell[][] simgrid, String player) |
static Robot.Robot_Specs | checkSpecsValid (Robot.Robot_Specs proposed, String player, int skill_points) throws RoboSimExecutionException |
Private Attributes | |
final int | WALL_HEALTH = 10 |
final int | WALL_DEFENSE = 10 |
SimGridCell[][] | worldGrid |
ArrayList< RobotData > | turnOrder |
int | turnOrder_pos |
SimulatorGUI | gui |
Definition at line 8 of file RoboSim.java.
RoboSim.RoboSim | ( | String[] | combatants, |
int | initial_robots_per_combatant, | ||
int | skill_points, | ||
int | length, | ||
int | width, | ||
int | obstacles | ||
) | throws RoboSimExecutionException |
Constructor for RoboSim:
combatants | array of String objects containing the names of the Robot classes for each combatant |
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 185 of file RoboSim.java.
References checkSpecsValid(), Robot.createRobot(), RoboSim.RobotData.robot, turnOrder, turnOrder_pos, WALL_HEALTH, and worldGrid.
|
staticprivate |
Definition at line 167 of file RoboSim.java.
Referenced by RoboSim.RoboAPIImplementor.finalizeBuilding(), and RoboSim().
String RoboSim.executeSingleTimeStep | ( | ) | throws RoboSimExecutionException |
Executes one timestep of the simulation.
Definition at line 1031 of file RoboSim.java.
References RoboSim.RobotData.status, turnOrder, and turnOrder_pos.
String RoboSim.getOccupantPlayer | ( | Robot.GridCell | to_convert | ) |
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 104 of file RoboSim.java.
|
private |
Helper method to retrieve a 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) |
Definition at line 119 of file RoboSim.java.
References worldGrid.
Referenced by RoboSim.RoboAPIImplementor.getVisibleNeighborhood(), and RoboSim.RoboAPIImplementor.getWorld().
Robot.GridCell [][] RoboSim.getWorldGrid | ( | ) |
This is so SimulatorGUI can get a copy of world
Definition at line 99 of file RoboSim.java.
References worldGrid.
|
staticprivate |
Sanitizer to create a GridCell[][] 2D array to give to client.
simgrid | SimGridCell 2D array with cells to sanitize |
player | String containing player's name. Used to create sanitized grid as it would be seen from player's perspective. |
Definition at line 139 of file RoboSim.java.
References Robot.GridCell.contents, RoboSim.SimGridCell.occupant_data, RoboSim.RobotData.player, and RoboSim.SimGridCell.wallforthealth.
Referenced by RoboSim.RoboAPIImplementor.getVisibleNeighborhood(), and RoboSim.RoboAPIImplementor.getWorld().
|
private |
Definition at line 96 of file RoboSim.java.
|
private |
Definition at line 94 of file RoboSim.java.
Referenced by executeSingleTimeStep(), RoboSim.RoboAPIImplementor.finalizeBuilding(), RoboSim.RoboAPIImplementor.processAttack(), RoboSim(), and RoboSim.RoboAPIImplementor.sendMessage().
|
private |
Definition at line 95 of file RoboSim.java.
Referenced by executeSingleTimeStep(), RoboSim.RoboAPIImplementor.processAttack(), and RoboSim().
|
private |
Definition at line 90 of file RoboSim.java.
|
private |
Definition at line 89 of file RoboSim.java.
Referenced by RoboSim.RoboAPIImplementor.finalizeBuilding(), and RoboSim().
|
private |
Definition at line 93 of file RoboSim.java.
Referenced by RoboSim.RoboAPIImplementor.capsuleAttack(), RoboSim.RoboAPIImplementor.charge(), RoboSim.RoboAPIImplementor.drop_capsule(), getSubGrid(), RoboSim.RoboAPIImplementor.getVisibleNeighborhood(), RoboSim.RoboAPIImplementor.getWorld(), getWorldGrid(), RoboSim.RoboAPIImplementor.meleeAttack(), RoboSim.RoboAPIImplementor.move(), RoboSim.RoboAPIImplementor.pick_up_capsule(), RoboSim.RoboAPIImplementor.rangedAttack(), RoboSim(), RoboSim.RoboAPIImplementor.scanEnemy(), RoboSim.RoboAPIImplementor.sendMessage(), and RoboSim.RoboAPIImplementor.setBuildTarget().