#include <Conditions.h>
Inheritance diagram for HoldAreaCond:


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 |
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.
| typedef bool(HoldAreaCond::* ) HoldAreaCond::set_func_t(const std::string &arg) |
| HoldAreaCond::HoldAreaCond | ( | ) | [inline] |
| 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 | ) |
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] |
1.4.7