TankCountCond Class Reference

This condition checks the number of tanks "alive" i.e. More...

#include <Conditions.h>

Inheritance diagram for TankCountCond:

Inheritance graph
[legend]
Collaboration diagram for TankCountCond:

Collaboration graph
[legend]
List of all members.

Public Types

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

Public Member Functions

 TankCountCond ()
virtual ~TankCountCond ()
virtual void evaluate ()
bool setTankCount (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
int count
NumOp * op

Detailed Description

This condition checks the number of tanks "alive" i.e.

with a health greater than zero. The (xml) type of this condition is tank_count 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 tank count and value is true for the team specified in team.

This is an example where the condition will be true if team 2 has less then 5 tanks.

 <cond>
 <type>tank_count</type>
 <operator>l</operator>
 <value>5</value>
 <team>2</team>
 <name>NO_TANKS_2</name>
 </cond>


Member Typedef Documentation

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


Constructor & Destructor Documentation

TankCountCond::TankCountCond (  )  [inline]

virtual TankCountCond::~TankCountCond (  )  [virtual]


Member Function Documentation

virtual void TankCountCond::evaluate (  )  [virtual]

Implements Cond::Bool.

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

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

bool TankCountCond::setTankCount ( const std::string &  countStr  ) 

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


Member Data Documentation

int TankCountCond::count [private]

NumOp* TankCountCond::op [private]

int TankCountCond::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