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 ObjectType enumerator
60 Player
, Item
, Level
, Master
, Monster
63 //! Get the name of an object type
64 static string
GetName(ObjectType objecttype
);
66 //! Parse the name and return the enumeration value
67 static ObjectType
Parse(const string
&objecttype
);
70 //! Internal struct to hold type information statically in a table
71 typedef struct objecttypeinfo
73 ObjectTypes::ObjectType objecttype
; //!< The ObjectType enumeration value
74 string name
; //!< The Name of the type
77 static const objecttypeinfo mObjectTypeInfoTable
[];
79 }; // ObjectTypes class
84 //! Logical Modifer enumerator
87 strength
, defense
, maxhealth
, health
, forestfights
, playerfights
, gold
, bank
90 //! Get the name of a modifier
91 static string
GetName(Modifier modifier
);
93 //! Parse the name and return the modifier enumeration value
94 static Modifier
Parse(const string
&modifier
);
96 typedef struct modifierinfo
98 Modifiers::Modifier modifier
; //!< The modifier enumeration value
99 string name
; //!< The name of the modifier
101 static const modifierinfo mModifierInfoTable
[];
102 }; // Modifiers class
108 Range(const int &high
, const int &low
);
111 //! Generate a random number within the range
114 //! Property get - High
115 int High(void) const;
117 //! Property set - High
118 void High(const int &value
);
120 //! Property get - Low
123 //! Property set - Low
124 void Low(const int &value
);
126 //! Property get - Last random number to be generated
127 int LastRandom(void) const;