#include <src/Utilities/Template.h>
List of all members.
Public Types |
typedef T | MyType |
typedef CompoundT< T >::BaseT | MyBase |
Public Member Functions |
void | Read (INI_EX *parser, const char *pSection, const char *pKey) |
bool | operator== (AbstractTypeClass *other) const |
template<> |
void | Read (INI_EX *parser, const char *pSection, const char *pKey) |
template<class T>
class ValueableVector< T >
Member Typedef Documentation
Member Function Documentation
template<class T>
bool ValueableVector< T >::operator== |
( |
AbstractTypeClass * |
other | ) |
const [inline] |
This will return true for Valuable<std::vector<AbstractTypeClass *> > Foo == AbstractTypeClass * Bar if Bar is among the objects listed in Foo.
This way, we can do stuff like if(SomeExt->AllowedUnits == someUnit) { ... even if AllowedUnits is a list.
{
if(this->empty()) {
return false;
}
int listSize = this->size();
for( int i = 0; i < listSize; ++i ) {
if(this->at(i) == other) {
return true;
}
}
return false;
}
template<>
void ValueableVector< TechnoTypeClass * >::Read |
( |
INI_EX * |
parser, |
|
|
const char * |
pSection, |
|
|
const char * |
pKey |
|
) |
| |
{
if(parser->ReadString(pSection, pKey)) {
for(char *cur = strtok(Ares::readBuffer, ","); cur; cur = strtok(NULL, ",")) {
TechnoTypeClass * thisObject = NULL;
if(thisObject = AircraftTypeClass::Find(cur)) {
this->push_back(thisObject);
continue;
}
if(thisObject = BuildingTypeClass::Find(cur)) {
this->push_back(thisObject);
continue;
}
if(thisObject = InfantryTypeClass::Find(cur)) {
this->push_back(thisObject);
continue;
}
if(thisObject = UnitTypeClass::Find(cur)) {
this->push_back(thisObject);
continue;
}
Debug::INIParseFailed(pSection, pKey, cur);
}
}
}
{
if(parser->ReadString(pSection, pKey)) {
for(char *cur = strtok(Ares::readBuffer, ","); cur; cur = strtok(NULL, ",")) {
if(T thisObject = MyBase::Find(cur)) {
this->push_back(thisObject);
continue;
}
}
}
}
The documentation for this class was generated from the following file: