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_DESCRIPTORS_H
00026 # define OGS_MAGIC_DESCRIPTORS_H
00027
00028 # pragma interface
00029
00030 # include <bitset>
00031 # include <string>
00032
00033 # include <ogs/magic/Namespace.h>
00034
00035 OGS_BEGIN_MAGIC_NAMESPACE
00036
00043 template <size_t Size>
00044 class DescriptorsBase: public std::bitset<Size> {
00045 public:
00053 typedef size_t Type;
00054
00056 static const Type ACID = 0;
00057
00059 static const Type CHAOTIC = 1;
00060
00062 static const Type COLD = 2;
00063
00065 static const Type DARKNESS = 3;
00066
00068 static const Type DEATH = 4;
00069
00071 static const Type ELECTRICITY = 5;
00072
00074 static const Type EVIL = 6;
00075
00077 static const Type FEAR = 7;
00078
00080 static const Type FIRE = 8;
00081
00083 static const Type FORCE = 9;
00084
00086 static const Type GOOD = 10;
00087
00089 static const Type LANGUAGE_DEPENDENT = 11;
00090
00092 static const Type LAWFUL = 12;
00093
00095 static const Type LIGHT = 13;
00096
00098 static const Type MIND_AFFECTING = 14;
00099
00101 static const Type SONIC = 15;
00102
00104 static const Type TELEPORTATION = 16;
00105
00106 static std::string getName (Type type);
00107 };
00108
00117 template <size_t Size>
00118 std::string DescriptorsBase<Size>::getName (Type type) {
00119 return (type == ACID? "Acid":
00120 type == CHAOTIC? "Chaotic":
00121 type == COLD? "Cold":
00122 type == DARKNESS? "Darkness":
00123 type == DEATH? "Death":
00124 type == ELECTRICITY? "Electricity":
00125 type == EVIL? "Evil":
00126 type == FEAR? "Fear":
00127 type == FIRE? "Fire":
00128 type == FORCE? "Force":
00129 type == GOOD? "Good":
00130 type == LANGUAGE_DEPENDENT? "Language-Dependent":
00131 type == LAWFUL? "Lawful":
00132 type == LIGHT? "Light":
00133 type == MIND_AFFECTING? "Mind-Affecting":
00134 type == SONIC? "Sonic":
00135 type == TELEPORTATION? "Teleportation": "");
00136 }
00137
00141 typedef DescriptorsBase<32> Descriptors;
00142
00143 OGS_END_MAGIC_NAMESPACE
00144
00145 # endif
00146
00147 #endif
00148