HoldAreaCond Class Reference

This condition evaluates to true if an area is held for a specified amount of time. More...

#include <Conditions.h>

Inheritance diagram for HoldAreaCond:

Inheritance graph
[legend]
Collaboration diagram for HoldAreaCond:

Collaboration graph
[legend]
List of all members.

Public Types

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

Public Member Functions

 HoldAreaCond ()
virtual void evaluate ()
bool setArea (const std::string &areaCoords)
bool setTime (const std::string &time)
bool setTeamNumber (const std::string &teamNo)
virtual set_func_t funcForType (const std::string &type)

Private Attributes

int team
double time
double curTime
std::vector< float > x_coords
std::vector< float > y_coords

Detailed Description

This condition evaluates to true if an area is held for a specified amount of time.

The current definition of holding an area is to have one or more alive tanks inside the area (this might be subject to change). The (xml) type of this condition is hold_area and it has three parameters, coords (float_list), time int and team (int). The condition is satisfied if the team holds the area specified by coords for time seconds.

This is an example where the condition will be true if team 1 held the area enclosed by [100 100], [200 100], [200 200], [100 200] for 5 seconds.

 <cond>
 <type>hold_area</type>
 <team>1</team>
 <coords>100 100 200 100 200 200 100 200</coords>
 <time>5</time>
 <name>IN_AREA</name>
 </cond>

The coords is a list of coordinates on the form x1 y1 x2 y2 x3 y3 ... that describes a polygon.


Member Typedef Documentation

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


Constructor & Destructor Documentation

HoldAreaCond::HoldAreaCond (  )  [inline]


Member Function Documentation

virtual void HoldAreaCond::evaluate (  )  [virtual]

Implements Cond::Bool.

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

bool HoldAreaCond::setArea ( const std::string &  areaCoords  ) 

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

bool HoldAreaCond::setTime ( const std::string &  time  ) 


Member Data Documentation

double HoldAreaCond::curTime [private]

int HoldAreaCond::team [private]

double HoldAreaCond::time [private]

std::vector<float> HoldAreaCond::x_coords [private]

std::vector<float> HoldAreaCond::y_coords [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