TeamPowerCond Class Reference

Each team has a power associated with it that may depend on factors such as it's current resources (tanks, airplains, supplies etc) and their health. More...

#include <Conditions.h>

Inheritance diagram for TeamPowerCond:

Inheritance graph
[legend]
Collaboration diagram for TeamPowerCond:

Collaboration graph
[legend]
List of all members.

Public Types

typedef bool(TeamPowerCond::*) set_func_t (const std::string &arg)

Public Member Functions

 TeamPowerCond ()
virtual ~TeamPowerCond ()
virtual void evaluate ()
bool setPower (const std::string &countStr)
bool setOperator (const std::string &oper)
bool setTeamNumber (const std::string &teamNo)
virtual set_func_t funcForType (const std::string &type)

Private Attributes

int team
double power
NumOp * op

Detailed Description

Each team has a power associated with it that may depend on factors such as it's current resources (tanks, airplains, supplies etc) and their health.

This condition works evaluates that power. The (xml) type of this condition is team_power and it has three parameters, value (int), operator</tt> (l, g, leq, geq, eq) and team (int). The condition is satisfied if the operator applied to the current team power and value is true for the team specified in team.

This is an example where the condition will be true if team 2 is weak (i.e. has a power of less than 100).

 <cond>
 <type>team_power</type>
 <operator>l</operator>
 <value>100</value>
 <team>2</team>
 <name>WEAK_TEAM_2</name>
 </cond>


Member Typedef Documentation

typedef bool(TeamPowerCond::* ) TeamPowerCond::set_func_t(const std::string &arg)


Constructor & Destructor Documentation

TeamPowerCond::TeamPowerCond (  )  [inline]

virtual TeamPowerCond::~TeamPowerCond (  )  [virtual]


Member Function Documentation

virtual void TeamPowerCond::evaluate (  )  [virtual]

Implements Cond::Bool.

virtual set_func_t TeamPowerCond::funcForType ( const std::string &  type  )  [virtual]

bool TeamPowerCond::setOperator ( const std::string &  oper  ) 

bool TeamPowerCond::setPower ( const std::string &  countStr  ) 

bool TeamPowerCond::setTeamNumber ( const std::string &  teamNo  ) 


Member Data Documentation

NumOp* TeamPowerCond::op [private]

double TeamPowerCond::power [private]

int TeamPowerCond::team [private]


The documentation for this class was generated from the following file:
Generated on Sun Mar 11 15:33:26 2007 for MetalWarriors by  doxygen 1.4.7