1 #ifndef _Enums_h_ 2 #define _Enums_h_ 3 4 #include <GG/Enum.h> 5 6 #include <iostream> 7 #include <string> 8 #include <vector> 9 10 #include "../util/Export.h" 11 12 /* the various major subclasses of UniverseObject */ 13 GG_ENUM(UniverseObjectType, 14 INVALID_UNIVERSE_OBJECT_TYPE = -1, 15 OBJ_BUILDING, 16 OBJ_SHIP, 17 OBJ_FLEET, 18 OBJ_PLANET, 19 OBJ_POP_CENTER, 20 OBJ_PROD_CENTER, 21 OBJ_SYSTEM, 22 OBJ_FIELD, 23 OBJ_FIGHTER, 24 NUM_OBJ_TYPES 25 ) 26 27 /** types of stars */ 28 GG_ENUM(StarType, 29 INVALID_STAR_TYPE = -1, 30 STAR_BLUE, 31 STAR_WHITE, 32 STAR_YELLOW, 33 STAR_ORANGE, 34 STAR_RED, 35 STAR_NEUTRON, 36 STAR_BLACK, 37 STAR_NONE, 38 NUM_STAR_TYPES 39 ) 40 41 /** types of planets */ 42 GG_ENUM(PlanetType, 43 INVALID_PLANET_TYPE = -1, 44 PT_SWAMP, 45 PT_TOXIC, 46 PT_INFERNO, 47 PT_RADIATED, 48 PT_BARREN, 49 PT_TUNDRA, 50 PT_DESERT, 51 PT_TERRAN, 52 PT_OCEAN, 53 PT_ASTEROIDS, 54 PT_GASGIANT, 55 NUM_PLANET_TYPES 56 ) 57 58 /** sizes of planets */ 59 GG_ENUM(PlanetSize, 60 INVALID_PLANET_SIZE = -1, 61 SZ_NOWORLD, ///< used to designate an empty planet slot 62 SZ_TINY, 63 SZ_SMALL, 64 SZ_MEDIUM, 65 SZ_LARGE, 66 SZ_HUGE, 67 SZ_ASTEROIDS, 68 SZ_GASGIANT, 69 NUM_PLANET_SIZES 70 ) 71 72 /** environmental suitability of planets for a particular race */ 73 GG_ENUM(PlanetEnvironment, 74 INVALID_PLANET_ENVIRONMENT = -1, 75 PE_UNINHABITABLE, 76 PE_HOSTILE, 77 PE_POOR, 78 PE_ADEQUATE, 79 PE_GOOD, 80 NUM_PLANET_ENVIRONMENTS 81 ) 82 83 /** Types for Meters 84 * Only active paired meters should lie between METER_POPULATION and METER_TROOPS 85 * (See: UniverseObject::ResetPairedActiveMeters()) 86 */ 87 GG_ENUM(MeterType, 88 INVALID_METER_TYPE = -1, 89 METER_TARGET_POPULATION, 90 METER_TARGET_INDUSTRY, 91 METER_TARGET_RESEARCH, 92 METER_TARGET_TRADE, 93 METER_TARGET_CONSTRUCTION, 94 METER_TARGET_HAPPINESS, 95 96 METER_MAX_CAPACITY, 97 METER_MAX_SECONDARY_STAT, 98 99 METER_MAX_FUEL, 100 METER_MAX_SHIELD, 101 METER_MAX_STRUCTURE, 102 METER_MAX_DEFENSE, 103 METER_MAX_SUPPLY, 104 METER_MAX_STOCKPILE, 105 METER_MAX_TROOPS, 106 107 METER_POPULATION, 108 METER_INDUSTRY, 109 METER_RESEARCH, 110 METER_TRADE, 111 METER_CONSTRUCTION, 112 METER_HAPPINESS, 113 114 METER_CAPACITY, 115 METER_SECONDARY_STAT, 116 117 METER_FUEL, 118 METER_SHIELD, 119 METER_STRUCTURE, 120 METER_DEFENSE, 121 METER_SUPPLY, 122 METER_STOCKPILE, 123 METER_TROOPS, 124 125 METER_REBEL_TROOPS, 126 METER_SIZE, 127 METER_STEALTH, 128 METER_DETECTION, 129 METER_SPEED, 130 131 NUM_METER_TYPES 132 ) 133 134 /** types of universe shapes during galaxy generation */ 135 GG_ENUM(Shape, 136 INVALID_SHAPE = -1, 137 SPIRAL_2, ///< a two-armed spiral galaxy 138 SPIRAL_3, ///< a three-armed spiral galaxy 139 SPIRAL_4, ///< a four-armed spiral galaxy 140 CLUSTER, ///< a cluster galaxy 141 ELLIPTICAL, ///< an elliptical galaxy 142 DISC, ///< a disc shaped galaxy 143 BOX, ///< a rectangular shaped galaxy 144 IRREGULAR, ///< an irregular galaxy 145 RING, ///< a ring galaxy 146 RANDOM, ///< a random one of the other shapes 147 GALAXY_SHAPES ///< the number of shapes in this enum (leave this last) 148 ) 149 150 /** levels of AI Aggression during galaxy generation */ 151 GG_ENUM(Aggression, 152 INVALID_AGGRESSION = -1, 153 BEGINNER, 154 TURTLE, ///< Very Defensive 155 CAUTIOUS, ///< Somewhat Defensive 156 TYPICAL, ///< Typical 157 AGGRESSIVE, ///< Aggressive 158 MANIACAL, ///< Very Aggressive 159 NUM_AI_AGGRESSION_LEVELS 160 ) 161 162 /** General-use option for galaxy setup picks with "more" or "less" options. */ 163 GG_ENUM(GalaxySetupOption, 164 INVALID_GALAXY_SETUP_OPTION = -1, 165 GALAXY_SETUP_NONE, 166 GALAXY_SETUP_LOW, 167 GALAXY_SETUP_MEDIUM, 168 GALAXY_SETUP_HIGH, 169 GALAXY_SETUP_RANDOM, 170 NUM_GALAXY_SETUP_OPTIONS 171 ) 172 173 /** types of diplomatic empire affiliations to another empire*/ 174 GG_ENUM(EmpireAffiliationType, 175 INVALID_EMPIRE_AFFIL_TYPE = -1, 176 AFFIL_SELF, ///< the given empire iteslf 177 AFFIL_ENEMY, ///< enemies of the given empire 178 AFFIL_PEACE, ///< empires at peace with the given empire 179 AFFIL_ALLY, ///< allies of the given empire 180 AFFIL_ANY, ///< any empire 181 AFFIL_NONE, ///< no empire 182 AFFIL_CAN_SEE, ///< special case enum used to specify empires that can detect particular objects, for use in effects or conditions 183 AFFIL_HUMAN, ///< empire controlled by a human player 184 NUM_AFFIL_TYPES ///< keep last, the number of affiliation types 185 ) 186 187 /** diplomatic statuses */ 188 GG_ENUM(DiplomaticStatus, 189 INVALID_DIPLOMATIC_STATUS = -1, 190 DIPLO_WAR, 191 DIPLO_PEACE, 192 DIPLO_ALLIED, 193 NUM_DIPLO_STATUSES 194 ) 195 196 /** Research status of techs, relating to whether they have been or can be researched */ 197 GG_ENUM(TechStatus, 198 INVALID_TECH_STATUS = -1, 199 TS_UNRESEARCHABLE, ///< never researchable, or has no researched prerequisites 200 TS_HAS_RESEARCHED_PREREQ, ///< has at least one researched, and at least one unreserached, prerequisite 201 TS_RESEARCHABLE, ///< all prerequisites researched 202 TS_COMPLETE, ///< has been researched 203 NUM_TECH_STATUSES 204 ) 205 206 /** The general type of production being done at a ProdCenter. Within each valid type, a specific kind 207 of item is being built, e.g. under BUILDING a kind of building called "SuperFarm" might be built. */ 208 GG_ENUM(BuildType, 209 INVALID_BUILD_TYPE = -1, 210 BT_NOT_BUILDING, ///< no building is taking place 211 BT_BUILDING, ///< a Building object is being built 212 BT_SHIP, ///< a Ship object is being built 213 BT_PROJECT, ///< a project may produce effects while on the queue, may or may not ever complete, and does not result in a ship or building being produced 214 BT_STOCKPILE, 215 NUM_BUILD_TYPES 216 ) 217 218 /** Types of resources that planets can produce */ 219 GG_ENUM(ResourceType, 220 INVALID_RESOURCE_TYPE = -1, 221 RE_INDUSTRY, 222 RE_TRADE, 223 RE_RESEARCH, 224 RE_STOCKPILE, 225 NUM_RESOURCE_TYPES 226 ) 227 228 /* Types of slots in hulls. Parts may be restricted to only certain slot types */ 229 GG_ENUM(ShipSlotType, 230 INVALID_SHIP_SLOT_TYPE = -1, 231 SL_EXTERNAL, ///< external slots. more easily damaged 232 SL_INTERNAL, ///< internal slots. more protected, fewer in number 233 SL_CORE, 234 NUM_SHIP_SLOT_TYPES 235 ) 236 237 238 /** Returns the equivalent meter type for the given resource type; if no such 239 * meter type exists, returns INVALID_METER_TYPE. */ 240 FO_COMMON_API MeterType ResourceToMeter(ResourceType type); 241 FO_COMMON_API MeterType ResourceToTargetMeter(ResourceType type); 242 243 /** Returns the equivalent resource type for the given meter type; if no such 244 * resource type exists, returns INVALID_RESOURCE_TYPE. */ 245 FO_COMMON_API ResourceType MeterToResource(MeterType type); 246 247 /** Returns mapping from active to target or max meter types that correspond. 248 * eg. METER_RESEARCH -> METER_TARGET_RESEARCH */ 249 FO_COMMON_API const std::map<MeterType, MeterType>& AssociatedMeterTypes(); 250 251 /** Returns the target or max meter type that is associated with the given 252 * active meter type. If no associated meter type exists, INVALID_METER_TYPE 253 * is returned. */ 254 FO_COMMON_API MeterType AssociatedMeterType(MeterType meter_type); 255 256 257 /** degrees of visibility an Empire or UniverseObject can have for an 258 * UniverseObject. determines how much information the empire 259 * gets about the (non)visible object. */ 260 GG_ENUM(Visibility, 261 INVALID_VISIBILITY = -1, 262 VIS_NO_VISIBILITY, 263 VIS_BASIC_VISIBILITY, 264 VIS_PARTIAL_VISIBILITY, 265 VIS_FULL_VISIBILITY, 266 NUM_VISIBILITIES 267 ) 268 269 270 /** Possible results of an UniverseObject being captured by other empires, or an 271 * object's containing UniverseObject being captured, or the location of a 272 * Production Queue Build Item being conquered, or the result of other future 273 * events, such as spy activity... */ 274 GG_ENUM(CaptureResult, 275 INVALID_CAPTURE_RESULT = -1, 276 CR_CAPTURE, // object has ownership by original empire(s) removed, and conquering empire added 277 CR_DESTROY, // object is destroyed 278 CR_RETAIN // object ownership unchanged: original empire(s) still own object 279 ) 280 281 /** Types of in-game things that might contain an EffectsGroup, or "cause" effects to occur */ 282 GG_ENUM(EffectsCauseType, 283 INVALID_EFFECTS_GROUP_CAUSE_TYPE = -1, 284 ECT_UNKNOWN_CAUSE, 285 ECT_INHERENT, 286 ECT_TECH, 287 ECT_BUILDING, 288 ECT_FIELD, 289 ECT_SPECIAL, 290 ECT_SPECIES, 291 ECT_SHIP_PART, 292 ECT_SHIP_HULL 293 ) 294 295 /** Used for tracking what moderator action is set */ 296 GG_ENUM(ModeratorActionSetting, 297 MAS_NoAction, 298 MAS_Destroy, 299 MAS_SetOwner, 300 MAS_AddStarlane, 301 MAS_RemoveStarlane, 302 MAS_CreateSystem, 303 MAS_CreatePlanet 304 ) 305 306 /** Types of root directories */ 307 GG_ENUM(PathType, 308 PATH_BINARY, 309 PATH_RESOURCE, 310 PATH_PYTHON, 311 PATH_DATA_ROOT, 312 PATH_DATA_USER, 313 PATH_CONFIG, 314 PATH_SAVE, 315 PATH_TEMP, 316 PATH_INVALID 317 ) 318 319 /** Returns a string representation of PathType */ 320 FO_COMMON_API const std::string& PathTypeToString(PathType path_type); 321 322 /** Returns a vector of strings for all PathTypes */ 323 FO_COMMON_API const std::vector<std::string>& PathTypeStrings(); 324 325 326 #endif // _Enums_h_ 327