34 bool operator()(
const GridCell& potential_ally);
39 static const int WALL_HEALTH = 10;
40 static const int WALL_DEFENSE = 10;
68 vector<vector<GridCell> > getSanitizedSubGrid(
int x_left,
int y_up,
int x_right,
int y_down,
int player)
const;
82 RoboSim(
int initial_robots_per_combatant,
int skill_points,
int length,
int width,
int obstacles);
128 int luckOfAttacker = rand()%10;
129 return luckOfAttacker+attack-defense>=5;
157 void pick_up_capsule(
GridCell& adjacent_cell);
158 void drop_capsule(
GridCell& adjacent_cell,
int power_of_capsule);
177 void finalizeBuilding(vector<uint8_t> creation_message);
183 setBuildTarget(status,location,vector<uint8_t>());
217 if(!isAdjacent(ally))
240 if(power < 1 || power > 2)
243 if(message.size()!=64)
272 const int x_left = (xloc - range < 0) ? 0 : (xloc - range);
273 const int x_right = (xloc + range > rsim.
worldGrid.size()-1) ? (rsim.
worldGrid.size()-1) : (xloc + range);
274 const int y_up = (yloc - range < 0) ? 0 : (yloc - range);
275 const int y_down = (yloc + range > rsim.
worldGrid[0].size() - 1) ? (rsim.
worldGrid[0].size()-1) : (yloc + range);
279 to_return[xloc - x_left][yloc - y_up].contents=
SELF;
334 for(turnOrder_pos=0; turnOrder_pos<turnOrder.size(); turnOrder_pos++)
337 RobotData& data = turnOrder[turnOrder_pos];
358 int player = turnOrder[0].player;
359 for(
int i=1; i<turnOrder.size(); i++)
360 if(turnOrder[i].player!=player)
SimGridAllyDeterminant(const GridCell &origin_)
RobotData * occupant_data
vector< vector< uint8_t > > buffered_radio
vector< vector< GridCell > > getVisibleNeighborhood()
RoboAPIImplementor(RoboSim &rsim_, RobotData &actingRobot_)
vector< vector< GridCell > > getWorld(int power)
BuildStatus getBuildStatus()
void scanEnemy(Robot_Specs &enemySpecs, Robot_Status &enemyStatus, GridCell toScan)
bool isAdjacent(GridCell adjacent_cell)
vector< RobotData > turnOrder
void charge(int power, GridCell &ally)
vector< vector< GridCell > > & getWorldGrid()
int getOccupantPlayer(const GridCell &cell) const
int executeSingleTimeStep()
GridCell * getBuildTarget()
void setBuildTarget(BuildStatus status, GridCell *location)
vector< vector< GridCell > > worldGrid
int getInvestedBuildPower()
vector< vector< GridCell > > getSanitizedSubGrid(int x_left, int y_up, int x_right, int y_down, int player) const
static GridCell * findNearestAlly(GridCell &origin, std::vector< std::vector< GridCell > > &grid)
GridCell * invested_assoc_cell
void sendMessage(vector< uint8_t > message, int power)
bool calculateHit(int attack, int defense)
virtual void act(WorldAPI &api, Robot_Status status, std::vector< std::vector< std::uint8_t > > received_radio)=0