Ares
Public Types | Static Public Member Functions

SuperWeaponTarget Class Reference

#include <src/Utilities/Enums.h>

List of all members.

Public Types

enum  {
  None = 0x0, Land = 0x1, Water = 0x2, NoContent = 0x4,
  Infantry = 0x8, Unit = 0x10, Building = 0x20, All = 0xFF,
  AllCells = Land | Water, AllTechnos = Infantry | Unit | Building, AllContents = NoContent | AllTechnos
}
typedef unsigned char Value

Static Public Member Functions

static bool Parse (char *key, Value *value)

Member Typedef Documentation

typedef unsigned char SuperWeaponTarget::Value

Member Enumeration Documentation

anonymous enum
Enumerator:
None 
Land 
Water 
NoContent 
Infantry 
Unit 
Building 
All 
AllCells 
AllTechnos 
AllContents 
             {
                None = 0x0,
                Land = 0x1,
                Water = 0x2,
                NoContent = 0x4,
                Infantry = 0x8,
                Unit = 0x10,
                Building = 0x20,

                All = 0xFF,
                AllCells = Land | Water,
                AllTechnos = Infantry | Unit | Building,
                AllContents = NoContent | AllTechnos
        };

Member Function Documentation

static bool SuperWeaponTarget::Parse ( char *  key,
Value value 
) [inline, static]
                                                   {
                if(key && value) {
                        Value ret = SuperWeaponTarget::None;
                        for(char *cur = strtok(key, ","); cur; cur = strtok(NULL, Ares::readDelims)) {
                                if(!_strcmpi(cur, "land")) {
                                        ret |= SuperWeaponTarget::Land;
                                } else if(!_strcmpi(cur, "water")) {
                                        ret |= SuperWeaponTarget::Water;
                                } else if(!_strcmpi(cur, "empty")) {
                                        ret |= SuperWeaponTarget::NoContent;
                                } else if(!_strcmpi(cur, "infantry")) {
                                        ret |= SuperWeaponTarget::Infantry;
                                } else if(!_strcmpi(cur, "units")) {
                                        ret |= SuperWeaponTarget::Unit;
                                } else if(!_strcmpi(cur, "buildings")) {
                                        ret |= SuperWeaponTarget::Building;
                                } else if(!_strcmpi(cur, "all")) {
                                        ret |= SuperWeaponTarget::All;
                                }
                        }
                        *value = ret;
                        return true;
                }
                return false;
        }

The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines