RoboSim::SimGridAllyDeterminant Class Reference

#include <RoboSim.hpp>

Collaboration diagram for RoboSim::SimGridAllyDeterminant:

Public Member Functions

 SimGridAllyDeterminant (const GridCell &origin_)
 
bool operator() (const GridCell &potential_ally)
 

Private Attributes

const GridCellorigin
 

Detailed Description

FSPPredicate derivative making use of SimGridCell-specific information

Definition at line 26 of file RoboSim.hpp.

Constructor & Destructor Documentation

RoboSim::SimGridAllyDeterminant::SimGridAllyDeterminant ( const GridCell origin_)
inline

Definition at line 32 of file RoboSim.hpp.

32 : origin(origin_) { }

Member Function Documentation

bool RoboSim::SimGridAllyDeterminant::operator() ( const GridCell potential_ally)

Definition at line 14 of file RoboSim.cpp.

References robot_api::ALLY, robot_api::GridCell::contents, robot_api::GridCell::has_private_members, robot_api::GridCell::occupant_data, robot_api::RobotData::player, and robot_api::SELF.

15 {
16  if(&potential_ally==&origin)
17  return false;
18 
19  switch(potential_ally.contents)
20  {
21  case ALLY:
22  return true;
23  case SELF:
24  if(!potential_ally.has_private_members || !origin.has_private_members)
25  return false;
26  if(potential_ally.occupant_data!=NULL && origin.occupant_data!=NULL &&
28  return true;
29  default:
30  return false;
31  }
32 }
RobotData * occupant_data
Definition: robot_api.hpp:96
GridObject contents
Definition: robot_api.hpp:83

Member Data Documentation

const GridCell& RoboSim::SimGridAllyDeterminant::origin
private

Definition at line 29 of file RoboSim.hpp.


The documentation for this class was generated from the following files: