1 #ifndef __GS__TYPES_H__
2 #define __GS__TYPES_H__
6 #include <GameServ/GameServException.h>
7 using GameServ::Exceptions::GameServException
;
14 //! Holds the exceptions related to types and their conversions
17 //! Generic type exception possibly due to conversion or improper usage
18 class TypeException
: public GameServException
21 TypeException(const string
&ErrorMsg
, const char *pFilename
, int SourceLine
);
22 TypeException(const string
&ErrorMsg
);
30 //! Logical ItemType enumerator
33 Weapon
, Armor
, Potion
, NOTYPE
36 //! Get the name of an item type
37 static string
GetName(ItemType itemtype
);
39 //! Parse the name and return the enumeration value
40 static ItemType
Parse(const string
&itemtype
);
43 //! Internal struct to hold type information statically in a table
44 typedef struct itemtypeinfo
46 ItemTypes::ItemType itemtype
; //!< The ItemType enumeration value
47 string name
; //!< The Name of the type
50 static const itemtypeinfo mItemTypeInfoTable
[];
57 //! Logical Modifer enumerator
60 strength
, defense
, maxhealth
, health
, forestfights
, playerfights
, gold
, bank
63 //! Get the name of a modifier
64 static string
GetName(Modifier modifier
);
66 //! Parse the name and return the modifier enumeration value
67 static Modifier
Parse(const string
&modifier
);
69 typedef struct modifierinfo
71 Modifiers::Modifier modifier
; //!< The modifier enumeration value
72 string name
; //!< The name of the modifier
74 static const modifierinfo mModifierInfoTable
[];
81 Range(const int &high
, const int &low
);
84 //! Generate a random number within the range
87 //! Property get - High
90 //! Property set - High
91 void High(const int &value
);
93 //! Property get - Low
96 //! Property set - Low
97 void Low(const int &value
);