00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifdef __cplusplus
00024
00025 # ifndef OGS_MAGIC_COMPONENT_H
00026 # define OGS_MAGIC_COMPONENT_H
00027
00028 # include <string>
00029
00030 # include <ogs/magic/Namespace.h>
00031
00032 OGS_BEGIN_MAGIC_NAMESPACE
00033
00043 class Component {
00044 public:
00046 enum Type {
00052 VERBAL = 1,
00053
00058 SOMANTIC = 2,
00059
00064 MATERIAL = 3,
00065
00070 FOCUS = 4,
00071
00076 DIVINE_FOCUS = 5,
00077
00082 EXPERIENCE_COST = 6
00083 };
00084
00085 static Component Verbal ();
00086 static Component Somantic ();
00087 static Component DivineFocus ();
00088
00089 Type getType () const;
00090 std::string getAbbreviation () const;
00091
00092 protected:
00093 Component (Type type);
00094
00095 private:
00096 Type _type;
00097
00098 static bool isValid (int value);
00099 };
00100
00106 inline Component Component::Verbal () {
00107 return (Component (Component::VERBAL));
00108 }
00109
00115 inline Component Component::Somantic () {
00116 return (Component (Component::SOMANTIC));
00117 }
00118
00124 inline Component Component::DivineFocus () {
00125 return (Component (Component::DIVINE_FOCUS));
00126 }
00127
00133 inline Component::Type Component::getType () const {
00134 return (this->_type);
00135 }
00136
00142 inline std::string Component::getAbbreviation () const {
00143 return (this->_type == VERBAL? "V":
00144 this->_type == SOMANTIC? "S":
00145 this->_type == MATERIAL? "M":
00146 this->_type == FOCUS? "F":
00147 this->_type == DIVINE_FOCUS? "DF":
00148 this->_type == EXPERIENCE_COST? "XP": "");
00149 }
00150
00157 inline bool Component::isValid (int value) {
00158 return (value == VERBAL ||
00159 value == SOMANTIC ||
00160 value == MATERIAL ||
00161 value == FOCUS ||
00162 value == DIVINE_FOCUS ||
00163 value == EXPERIENCE_COST);
00164 }
00165
00166 OGS_END_MAGIC_NAMESPACE
00167
00168 # endif
00169
00170 #endif
00171