Oolite 1.91.0.7645-241119-222d325
Loading...
Searching...
No Matches
OOConstToString.m File Reference
import "OOConstToString.h"
#include <jsapi.h>
import "OOCollectionExtractors.h"
import "Universe.h"
import "PlayerEntity.h"
import "OOEquipmentType.h"
#include "OOEntityStatus.tbl"
#include "OOBehaviour.tbl"
#include "OOCompassMode.tbl"
#include "OOLongRangeChartMode.tbl"
#include "OOGalacticHyperspaceBehaviour.tbl"
#include "OOGUIScreenID.tbl"
#include "OOScanClass.tbl"
#include "OOShipDamageType.tbl"
#include "OOLegalStatusReason.tbl"
+ Include dependency graph for OOConstToString.m:

Go to the source code of this file.

Macros

#define CASE(foo)
 
#define REVERSE_CASE(foo)
 
#define ENTRY(label, value)
 
#define GALACTIC_HYPERSPACE_ENTRY(label, value)
 
#define DIFF_STRING_ENTRY(label, string)
 
#define ENTRY(label, value)
 
#define GALACTIC_HYPERSPACE_ENTRY(label, value)
 

Functions

NSString * OOStringFromEntityStatus (OOEntityStatus value)
 
NSString * OOStringFromBehaviour (OOBehaviour value)
 
NSString * OOStringFromCompassMode (OOCompassMode value)
 
NSString * OOStringFromLongRangeChartMode (OOLongRangeChartMode value)
 
NSString * OOStringFromGalacticHyperspaceBehaviour (OOGalacticHyperspaceBehaviour value)
 
NSString * OOStringFromGUIScreenID (OOGUIScreenID value)
 
NSString * OOStringFromScanClass (OOScanClass value)
 
NSString * OOStringFromShipDamageType (OOShipDamageType value)
 
NSString * OOStringFromLegalStatusReason (OOLegalStatusReason value)
 
OOEntityStatus OOEntityStatusFromString (NSString *string)
 
OOCompassMode OOCompassModeFromString (NSString *string)
 
OOGalacticHyperspaceBehaviour OOGalacticHyperspaceBehaviourFromString (NSString *string)
 
OOGUIScreenID OOGUIScreenIDFromString (NSString *string)
 
OOScanClass OOScanClassFromString (NSString *string)
 
OOLongRangeChartMode OOLongRangeChartModeFromString (NSString *string)
 
NSString * RouteTypeToString (OORouteType routeType)
 
NSString * OODisplayStringFromGovernmentID (OOGovernmentID government)
 
NSString * OODisplayStringFromEconomyID (OOEconomyID economy)
 
NSString * JSTypeToString (int type)
 
NSString * OOStringFromWeaponType (OOWeaponType weapon)
 
OOWeaponType OOWeaponTypeFromString (NSString *string)
 
NSString * OOEquipmentIdentifierFromWeaponType (OOWeaponType weapon)
 
OOWeaponType OOWeaponTypeFromEquipmentIdentifierSloppy (NSString *string)
 
OOWeaponType OOWeaponTypeFromEquipmentIdentifierLegacy (NSString *string)
 
OOWeaponType OOWeaponTypeFromEquipmentIdentifierStrict (NSString *string)
 
NSString * CargoTypeToString (OOCargoType cargo)
 
OOCargoType StringToCargoType (NSString *string)
 
NSString * EnergyUnitTypeToString (OOEnergyUnitType unit)
 
OOEnergyUnitType StringToEnergyUnitType (NSString *string)
 
NSString * OODisplayRatingStringFromKillCount (unsigned kills)
 
NSString * KillCountToRatingAndKillString (unsigned kills)
 
NSString * OODisplayStringFromLegalStatus (int legalStatus)
 
NSString * OODisplayStringFromAlertCondition (OOAlertCondition alertCondition)
 
NSString * OODisplayStringFromShaderSetting (OOShaderSetting setting)
 
NSString * OOStringFromShaderSetting (OOShaderSetting setting)
 
OOShaderSetting OOShaderSettingFromString (NSString *string)
 
NSString * CommodityDisplayNameForSymbolicName (NSString *symbolicName)
 
NSString * CommodityDisplayNameForCommodityArray (NSArray *commodityDefinition)
 
NSString * DisplayStringForMassUnit (OOMassUnit unit)
 
NSString * DisplayStringForMassUnitForCommodity (OOCommodityType commodity)
 
OORouteType StringToRouteType (NSString *string)
 
NSString * DockingClearanceStatusToString (OODockingClearanceStatus dockingClearanceStatus)
 
NSString * OOStringFromGraphicsDetail (OOGraphicsDetail detail)
 
OOGraphicsDetail OOGraphicsDetailFromString (NSString *string)
 

Macro Definition Documentation

◆ CASE

◆ DIFF_STRING_ENTRY

#define DIFF_STRING_ENTRY ( label,
string )
Value:
case label: return @string;

Definition at line 39 of file OOConstToString.m.

◆ ENTRY [1/2]

#define ENTRY ( label,
value )
Value:
case label: return @#label;

Definition at line 37 of file OOConstToString.m.

◆ ENTRY [2/2]

#define ENTRY ( label,
value )
Value:
if ([string isEqualToString:@#label]) return label;

Definition at line 37 of file OOConstToString.m.

◆ GALACTIC_HYPERSPACE_ENTRY [1/2]

#define GALACTIC_HYPERSPACE_ENTRY ( label,
value )
Value:
case GALACTIC_HYPERSPACE_##label: return @#label;

Definition at line 38 of file OOConstToString.m.

◆ GALACTIC_HYPERSPACE_ENTRY [2/2]

#define GALACTIC_HYPERSPACE_ENTRY ( label,
value )
Value:
if ([string isEqualToString:@#label]) return GALACTIC_HYPERSPACE_##label;

Definition at line 38 of file OOConstToString.m.

◆ REVERSE_CASE

#define REVERSE_CASE ( foo)
Value:
if ([string isEqualToString:@#foo]) return foo;

Definition at line 34 of file OOConstToString.m.

Referenced by OOGraphicsDetailFromString(), OOShaderSettingFromString(), StringToCargoType(), StringToEnergyUnitType(), and StringToRouteType().

Function Documentation

◆ CargoTypeToString()

NSString * CargoTypeToString ( OOCargoType cargo)

Definition at line 338 of file OOConstToString.m.

339{
340 switch (cargo)
341 {
350 }
351 return @"Unknown cargo";
352}
#define CASE(foo)
@ CARGO_RANDOM
Definition OOTypes.h:75
@ CARGO_NOT_CARGO
Definition OOTypes.h:70
@ CARGO_THARGOID
Definition OOTypes.h:74
@ CARGO_CHARACTER
Definition OOTypes.h:77
@ CARGO_SLAVES
Definition OOTypes.h:71
@ CARGO_ALLOY
Definition OOTypes.h:72
@ CARGO_SCRIPTED_ITEM
Definition OOTypes.h:76
@ CARGO_MINERALS
Definition OOTypes.h:73

References CARGO_ALLOY, CARGO_CHARACTER, CARGO_MINERALS, CARGO_NOT_CARGO, CARGO_RANDOM, CARGO_SCRIPTED_ITEM, CARGO_SLAVES, CARGO_THARGOID, and CASE.

◆ CommodityDisplayNameForCommodityArray()

NSString * CommodityDisplayNameForCommodityArray ( NSArray * commodityDefinition)

Definition at line 513 of file OOConstToString.m.

514{
515 return CommodityDisplayNameForSymbolicName([commodityDefinition oo_stringAtIndex:MARKET_NAME]);
516}
NSString * CommodityDisplayNameForSymbolicName(NSString *symbolicName)
@ MARKET_NAME
Definition Universe.h:64

References CommodityDisplayNameForSymbolicName(), and MARKET_NAME.

+ Here is the call graph for this function:

◆ CommodityDisplayNameForSymbolicName()

NSString * CommodityDisplayNameForSymbolicName ( NSString * symbolicName)

Definition at line 506 of file OOConstToString.m.

507{
508 NSString *ret = [UNIVERSE descriptionForKey:[@"commodity-name " stringByAppendingString:[symbolicName lowercaseString]]];
509 return ret ? ret : symbolicName;
510}

Referenced by CommodityDisplayNameForCommodityArray(), and GlobalDisplayNameForCommodity().

+ Here is the caller graph for this function:

◆ DisplayStringForMassUnit()

NSString * DisplayStringForMassUnit ( OOMassUnit unit)

Definition at line 519 of file OOConstToString.m.

520{
521 switch (unit)
522 {
523 case UNITS_TONS: return DESC(@"cargo-tons-symbol");
524 case UNITS_KILOGRAMS: return DESC(@"cargo-kilograms-symbol");
525 case UNITS_GRAMS: return DESC(@"cargo-grams-symbol");
526 }
527
528 return @"??";
529}
@ UNITS_TONS
Definition OOTypes.h:124
@ UNITS_GRAMS
Definition OOTypes.h:126
@ UNITS_KILOGRAMS
Definition OOTypes.h:125
#define DESC(key)
Definition Universe.h:839

References DESC, UNITS_GRAMS, UNITS_KILOGRAMS, and UNITS_TONS.

Referenced by DisplayStringForMassUnitForCommodity().

+ Here is the caller graph for this function:

◆ DisplayStringForMassUnitForCommodity()

NSString * DisplayStringForMassUnitForCommodity ( OOCommodityType commodity)

Definition at line 532 of file OOConstToString.m.

533{
534 return DisplayStringForMassUnit([[UNIVERSE commodityMarket] massUnitForGood:commodity]);
535}
NSString * DisplayStringForMassUnit(OOMassUnit unit)
#define UNIVERSE
Definition Universe.h:833

References DisplayStringForMassUnit(), and UNIVERSE.

+ Here is the call graph for this function:

◆ DockingClearanceStatusToString()

NSString * DockingClearanceStatusToString ( OODockingClearanceStatus dockingClearanceStatus)

Definition at line 548 of file OOConstToString.m.

549{
550 switch (dockingClearanceStatus)
551 {
557 }
558
559 return @"DOCKING_CLEARANCE_STATUS_UNKNOWN";
560}
@ DOCKING_CLEARANCE_STATUS_TIMING_OUT
Definition OOTypes.h:172
@ DOCKING_CLEARANCE_STATUS_NOT_REQUIRED
Definition OOTypes.h:169
@ DOCKING_CLEARANCE_STATUS_GRANTED
Definition OOTypes.h:171
@ DOCKING_CLEARANCE_STATUS_NONE
Definition OOTypes.h:168
@ DOCKING_CLEARANCE_STATUS_REQUESTED
Definition OOTypes.h:170

References CASE, DOCKING_CLEARANCE_STATUS_GRANTED, DOCKING_CLEARANCE_STATUS_NONE, DOCKING_CLEARANCE_STATUS_NOT_REQUIRED, DOCKING_CLEARANCE_STATUS_REQUESTED, and DOCKING_CLEARANCE_STATUS_TIMING_OUT.

Referenced by PlayerGetProperty().

+ Here is the caller graph for this function:

◆ EnergyUnitTypeToString()

NSString * EnergyUnitTypeToString ( OOEnergyUnitType unit)

Definition at line 373 of file OOConstToString.m.

374{
375 switch (unit)
376 {
382
385 break;
386 }
387
388 return @"Unsupported energy unit";
389}
@ ENERGY_UNIT_NORMAL
Definition OOTypes.h:137
@ ENERGY_UNIT_NAVAL_DAMAGED
Definition OOTypes.h:134
@ ENERGY_UNIT_NAVAL
Definition OOTypes.h:138
@ OLD_ENERGY_UNIT_NORMAL
Definition OOTypes.h:135
@ ENERGY_UNIT_NONE
Definition OOTypes.h:132
@ OLD_ENERGY_UNIT_NAVAL
Definition OOTypes.h:136
@ ENERGY_UNIT_NORMAL_DAMAGED
Definition OOTypes.h:133

References CASE, ENERGY_UNIT_NAVAL, ENERGY_UNIT_NAVAL_DAMAGED, ENERGY_UNIT_NONE, ENERGY_UNIT_NORMAL, ENERGY_UNIT_NORMAL_DAMAGED, OLD_ENERGY_UNIT_NAVAL, and OLD_ENERGY_UNIT_NORMAL.

◆ JSTypeToString()

NSString * JSTypeToString ( int type)

Definition at line 246 of file OOConstToString.m.

247{
248 switch ((JSType)type)
249 {
250 CASE(JSTYPE_VOID);
251 CASE(JSTYPE_OBJECT);
252 CASE(JSTYPE_FUNCTION);
253 CASE(JSTYPE_STRING);
254 CASE(JSTYPE_NUMBER);
255 CASE(JSTYPE_BOOLEAN);
256 CASE(JSTYPE_NULL);
257 CASE(JSTYPE_XML);
258 CASE(JSTYPE_LIMIT);
259 }
260 return [NSString stringWithFormat:@"unknown (%u)", type];
261}

References CASE.

◆ KillCountToRatingAndKillString()

NSString * KillCountToRatingAndKillString ( unsigned kills)

Definition at line 432 of file OOConstToString.m.

433{
434 return [NSString stringWithFormat:@"%@ (%u)", OODisplayRatingStringFromKillCount(kills), kills];
435}

◆ OOCompassModeFromString()

OOCompassMode OOCompassModeFromString ( NSString * string)

Definition at line 151 of file OOConstToString.m.

152{
153 #include "OOCompassMode.tbl"
154
156}
@ kOOCompassModeDefault
Definition OOTypes.h:151

References kOOCompassModeDefault.

◆ OODisplayRatingStringFromKillCount()

NSString * OODisplayRatingStringFromKillCount ( unsigned kills)

Definition at line 404 of file OOConstToString.m.

405{
406 enum { kRatingCount = 9 };
407
408 NSArray *ratingNames = nil;
409 const unsigned killThresholds[kRatingCount - 1] =
410 {
411 0x0008,
412 0x0010,
413 0x0020,
414 0x0040,
415 0x0080,
416 0x0200,
417 0x0A00,
418 0x1900
419 };
420 unsigned i;
421
422 ratingNames = [[UNIVERSE descriptions] oo_arrayForKey:@"rating"];
423 for (i = 0; i < kRatingCount - 1; ++i)
424 {
425 if (kills < killThresholds[i]) return [ratingNames oo_stringAtIndex:i];
426 }
427
428 return [ratingNames oo_stringAtIndex:kRatingCount - 1];
429}
return nil

References nil.

Referenced by PlayerGetProperty().

+ Here is the caller graph for this function:

◆ OODisplayStringFromAlertCondition()

NSString * OODisplayStringFromAlertCondition ( OOAlertCondition alertCondition)

Definition at line 460 of file OOConstToString.m.

461{
462 NSArray *conditionNames = [[UNIVERSE descriptions] oo_arrayForKey:@"condition"];
463 return [conditionNames oo_stringAtIndex:alertCondition];
464}

◆ OODisplayStringFromEconomyID()

NSString * OODisplayStringFromEconomyID ( OOEconomyID economy)

Definition at line 230 of file OOConstToString.m.

231{
232 NSArray *strings = nil;
233 NSString *value = nil;
234
235 strings = [[UNIVERSE descriptions] objectForKey:@"economy"];
236 if ([strings isKindOfClass:[NSArray class]] && economy < [strings count])
237 {
238 value = [strings objectAtIndex:economy];
239 if ([value isKindOfClass:[NSString class]]) return value;
240 }
241
242 return nil;
243}
unsigned count

References count, and nil.

Referenced by SystemGetProperty().

+ Here is the caller graph for this function:

◆ OODisplayStringFromGovernmentID()

NSString * OODisplayStringFromGovernmentID ( OOGovernmentID government)

Definition at line 214 of file OOConstToString.m.

215{
216 NSArray *strings = nil;
217 NSString *value = nil;
218
219 strings = [[UNIVERSE descriptions] objectForKey:@"government"];
220 if ([strings isKindOfClass:[NSArray class]] && government < [strings count])
221 {
222 value = [strings objectAtIndex:government];
223 if ([value isKindOfClass:[NSString class]]) return value;
224 }
225
226 return nil;
227}

References count, and nil.

Referenced by SystemGetProperty().

+ Here is the caller graph for this function:

◆ OODisplayStringFromLegalStatus()

NSString * OODisplayStringFromLegalStatus ( int legalStatus)

Definition at line 438 of file OOConstToString.m.

439{
440 enum { kStatusCount = 3 };
441
442 NSArray *statusNames = nil;
443 const int statusThresholds[kStatusCount - 1] =
444 {
445 1,
446 51
447 };
448 unsigned i;
449
450 statusNames = [[UNIVERSE descriptions] oo_arrayForKey:@"legal_status"];
451 for (i = 0; i != kStatusCount - 1; ++i)
452 {
453 if (legalStatus < statusThresholds[i]) return [statusNames oo_stringAtIndex:i];
454 }
455
456 return [statusNames oo_stringAtIndex:kStatusCount - 1];
457}

References nil.

Referenced by PlayerGetProperty().

+ Here is the caller graph for this function:

◆ OODisplayStringFromShaderSetting()

NSString * OODisplayStringFromShaderSetting ( OOShaderSetting setting)

Definition at line 467 of file OOConstToString.m.

468{
469 switch (setting)
470 {
471 case SHADERS_NOT_SUPPORTED: return DESC(@"shaderfx-not-available");
472 case SHADERS_OFF: return DESC(@"shaderfx-off");
473 case SHADERS_SIMPLE: return DESC(@"shaderfx-simple");
474 case SHADERS_FULL: return DESC(@"shaderfx-full");
475 }
476
477 return @"??";
478}
@ SHADERS_FULL
Definition OOOpenGL.h:40
@ SHADERS_SIMPLE
Definition OOOpenGL.h:39
@ SHADERS_OFF
Definition OOOpenGL.h:38
@ SHADERS_NOT_SUPPORTED
Definition OOOpenGL.h:37

References DESC, SHADERS_FULL, SHADERS_NOT_SUPPORTED, SHADERS_OFF, and SHADERS_SIMPLE.

◆ OOEntityStatusFromString()

OOEntityStatus OOEntityStatusFromString ( NSString * string)

Definition at line 143 of file OOConstToString.m.

144{
145 #include "OOEntityStatus.tbl"
146
148}
@ kOOEntityStatusDefault
Definition Entity.h:325

References kOOEntityStatusDefault.

◆ OOEquipmentIdentifierFromWeaponType()

NSString * OOEquipmentIdentifierFromWeaponType ( OOWeaponType weapon)

Definition at line 280 of file OOConstToString.m.

281{
282 return [weapon identifier];
283}
NSString * identifier()

References OOEquipmentType::identifier.

+ Here is the call graph for this function:

◆ OOGalacticHyperspaceBehaviourFromString()

OOGalacticHyperspaceBehaviour OOGalacticHyperspaceBehaviourFromString ( NSString * string)

Definition at line 159 of file OOConstToString.m.

160{
161 #include "OOGalacticHyperspaceBehaviour.tbl"
162
163 // Transparently (but inefficiently) support american spelling. FIXME: remove in EMMSTRAN.
164 if ([string hasPrefix:@"BEHAVIOR_"])
165 {
166 string = [string substringFromIndex:[@"BEHAVIOR_" length]];
167 string = [@"BEHAVIOUR_" stringByAppendingString:string];
169 }
170
172}
OOGalacticHyperspaceBehaviour OOGalacticHyperspaceBehaviourFromString(NSString *string)
@ kOOGalacticHyperspaceBehaviourDefault

References kOOGalacticHyperspaceBehaviourDefault, and OOGalacticHyperspaceBehaviourFromString().

Referenced by OOGalacticHyperspaceBehaviourFromString().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ OOGraphicsDetailFromString()

OOGraphicsDetail OOGraphicsDetailFromString ( NSString * string)

Definition at line 577 of file OOConstToString.m.

578{
583
585}
#define REVERSE_CASE(foo)
@ DETAIL_LEVEL_EXTRAS
Definition OOTypes.h:247
@ DETAIL_LEVEL_SHADERS
Definition OOTypes.h:246
@ DETAIL_LEVEL_MINIMUM
Definition OOTypes.h:244
@ DETAIL_LEVEL_NORMAL
Definition OOTypes.h:245

References DETAIL_LEVEL_EXTRAS, DETAIL_LEVEL_MINIMUM, DETAIL_LEVEL_NORMAL, DETAIL_LEVEL_SHADERS, and REVERSE_CASE.

◆ OOGUIScreenIDFromString()

OOGUIScreenID OOGUIScreenIDFromString ( NSString * string)

Definition at line 175 of file OOConstToString.m.

176{
177 #include "OOGUIScreenID.tbl"
178
180}
@ kOOGUIScreenIDDefault

References kOOGUIScreenIDDefault.

◆ OOLongRangeChartModeFromString()

OOLongRangeChartMode OOLongRangeChartModeFromString ( NSString * string)

Definition at line 190 of file OOConstToString.m.

191{
192 #include "OOLongRangeChartMode.tbl"
193
195}
@ kOOLongRangeChartModeDefault
Definition OOTypes.h:53

References kOOLongRangeChartModeDefault.

Referenced by PlayerShipSetProperty().

+ Here is the caller graph for this function:

◆ OOScanClassFromString()

OOScanClass OOScanClassFromString ( NSString * string)

Definition at line 183 of file OOConstToString.m.

184{
185 #include "OOScanClass.tbl"
186
187 return kOOScanClassDefault;
188}
@ kOOScanClassDefault
Definition Entity.h:326

References kOOScanClassDefault.

◆ OOShaderSettingFromString()

OOShaderSetting OOShaderSettingFromString ( NSString * string)

◆ OOStringFromBehaviour()

NSString * OOStringFromBehaviour ( OOBehaviour value)

Definition at line 51 of file OOConstToString.m.

52{
53 switch (value)
54 {
55 #include "OOBehaviour.tbl"
56 }
57
58 return @"** BEHAVIOUR UNKNOWN **";
59}

◆ OOStringFromCompassMode()

NSString * OOStringFromCompassMode ( OOCompassMode value)

Definition at line 62 of file OOConstToString.m.

63{
64 switch (value)
65 {
66 #include "OOCompassMode.tbl"
67 }
68
69 return @"UNDEFINED";
70}

◆ OOStringFromEntityStatus()

NSString * OOStringFromEntityStatus ( OOEntityStatus value)

Definition at line 41 of file OOConstToString.m.

42{
43 switch (value)
44 {
45 #include "OOEntityStatus.tbl"
46 }
47 return @"UNDEFINED";
48}

◆ OOStringFromGalacticHyperspaceBehaviour()

NSString * OOStringFromGalacticHyperspaceBehaviour ( OOGalacticHyperspaceBehaviour value)

Definition at line 82 of file OOConstToString.m.

83{
84 switch (value)
85 {
86 #include "OOGalacticHyperspaceBehaviour.tbl"
87 }
88
89 return @"UNDEFINED";
90}

◆ OOStringFromGraphicsDetail()

NSString * OOStringFromGraphicsDetail ( OOGraphicsDetail detail)

Definition at line 563 of file OOConstToString.m.

564{
565 switch (detail)
566 {
571 }
572
573 return @"DETAIL_LEVEL_UNKNOWN";
574}

References CASE, DETAIL_LEVEL_EXTRAS, DETAIL_LEVEL_MINIMUM, DETAIL_LEVEL_NORMAL, and DETAIL_LEVEL_SHADERS.

◆ OOStringFromGUIScreenID()

NSString * OOStringFromGUIScreenID ( OOGUIScreenID value)

Definition at line 93 of file OOConstToString.m.

94{
95 switch (value)
96 {
97 #include "OOGUIScreenID.tbl"
98 }
99
100 return @"UNDEFINED";
101}

◆ OOStringFromLegalStatusReason()

NSString * OOStringFromLegalStatusReason ( OOLegalStatusReason value)

Definition at line 125 of file OOConstToString.m.

126{
127 switch (value)
128 {
129 #include "OOLegalStatusReason.tbl"
130 }
131
132 return @"UNDEFINED";
133}

◆ OOStringFromLongRangeChartMode()

NSString * OOStringFromLongRangeChartMode ( OOLongRangeChartMode value)

Definition at line 72 of file OOConstToString.m.

73{
74 switch (value)
75 {
76 #include "OOLongRangeChartMode.tbl"
77 }
78
79 return @"UNDEFINED";
80}

Referenced by PlayerShipGetProperty().

+ Here is the caller graph for this function:

◆ OOStringFromScanClass()

NSString * OOStringFromScanClass ( OOScanClass value)

Definition at line 104 of file OOConstToString.m.

105{
106 switch (value)
107 {
108 #include "OOScanClass.tbl"
109 }
110
111 return @"UNDEFINED";
112}

◆ OOStringFromShaderSetting()

NSString * OOStringFromShaderSetting ( OOShaderSetting setting)

Definition at line 481 of file OOConstToString.m.

482{
483 switch (setting)
484 {
489 }
490
491 return @"UNDEFINED";
492}

References CASE, SHADERS_FULL, SHADERS_NOT_SUPPORTED, SHADERS_OFF, and SHADERS_SIMPLE.

◆ OOStringFromShipDamageType()

NSString * OOStringFromShipDamageType ( OOShipDamageType value)

Definition at line 115 of file OOConstToString.m.

116{
117 switch (value)
118 {
119 #include "OOShipDamageType.tbl"
120 }
121
122 return @"UNDEFINED";
123}

◆ OOStringFromWeaponType()

NSString * OOStringFromWeaponType ( OOWeaponType weapon)

Definition at line 264 of file OOConstToString.m.

265{
266 if (weapon == nil) {
267 return @"EQ_WEAPON_NONE";
268 } else {
269 return [weapon identifier];
270 }
271}

References OOEquipmentType::identifier, and nil.

+ Here is the call graph for this function:

◆ OOWeaponTypeFromEquipmentIdentifierLegacy()

OOWeaponType OOWeaponTypeFromEquipmentIdentifierLegacy ( NSString * string)

Definition at line 307 of file OOConstToString.m.

308{
309 if ([string intValue] > 0)
310 {
311 switch ([string intValue])
312 {
313 case 2:
314 return OOWeaponTypeFromEquipmentIdentifierSloppy(@"EQ_WEAPON_PULSE_LASER");
315 case 3:
316 return OOWeaponTypeFromEquipmentIdentifierSloppy(@"EQ_WEAPON_BEAM_LASER");
317 case 4:
318 return OOWeaponTypeFromEquipmentIdentifierSloppy(@"EQ_WEAPON_MINING_LASER");
319 case 5:
320 return OOWeaponTypeFromEquipmentIdentifierSloppy(@"EQ_WEAPON_MILITARY_LASER");
321 case 10:
322 return OOWeaponTypeFromEquipmentIdentifierSloppy(@"EQ_WEAPON_THARGOID_LASER");
323 default:
325 }
326 }
328}
OOWeaponType OOWeaponTypeFromEquipmentIdentifierSloppy(NSString *string)

References OOWeaponTypeFromEquipmentIdentifierSloppy().

+ Here is the call graph for this function:

◆ OOWeaponTypeFromEquipmentIdentifierSloppy()

OOWeaponType OOWeaponTypeFromEquipmentIdentifierSloppy ( NSString * string)

Definition at line 286 of file OOConstToString.m.

287{
289 if (w == nil)
290 {
291 if (![string hasPrefix:@"EQ_"])
292 {
293 w = [OOEquipmentType equipmentTypeWithIdentifier:[NSString stringWithFormat:@"EQ_%@",string]];
294 if (w != nil)
295 {
296 return w;
297 }
298 }
299 return [OOEquipmentType equipmentTypeWithIdentifier:@"EQ_WEAPON_NONE"];
300 }
301 return w;
302}
OOEquipmentType * equipmentTypeWithIdentifier:(NSString *identifier)

References OOEquipmentType::equipmentTypeWithIdentifier:, and nil.

Referenced by OOWeaponTypeFromEquipmentIdentifierLegacy(), OOWeaponTypeFromEquipmentIdentifierStrict(), OOWeaponTypeFromString(), and StationAddShipToShipyard().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ OOWeaponTypeFromEquipmentIdentifierStrict()

OOWeaponType OOWeaponTypeFromEquipmentIdentifierStrict ( NSString * string)

Definition at line 331 of file OOConstToString.m.

332{
333 // there is no difference between the two any more
335}

References OOWeaponTypeFromEquipmentIdentifierSloppy().

+ Here is the call graph for this function:

◆ OOWeaponTypeFromString()

OOWeaponType OOWeaponTypeFromString ( NSString * string)

Definition at line 274 of file OOConstToString.m.

275{
277}

References OOWeaponTypeFromEquipmentIdentifierSloppy().

+ Here is the call graph for this function:

◆ RouteTypeToString()

NSString * RouteTypeToString ( OORouteType routeType)

Definition at line 201 of file OOConstToString.m.

202{
203 switch (routeType)
204 {
208 }
209
210 return @"** ROUTE TYPE UNKNOWN **";
211}
@ OPTIMIZED_BY_NONE
Definition OOTypes.h:34
@ OPTIMIZED_BY_JUMPS
Definition OOTypes.h:35
@ OPTIMIZED_BY_TIME
Definition OOTypes.h:36

References CASE, OPTIMIZED_BY_JUMPS, OPTIMIZED_BY_NONE, and OPTIMIZED_BY_TIME.

◆ StringToCargoType()

OOCargoType StringToCargoType ( NSString * string)

◆ StringToEnergyUnitType()

◆ StringToRouteType()

OORouteType StringToRouteType ( NSString * string)

Definition at line 538 of file OOConstToString.m.

References kOORouteTypeDefault, OPTIMIZED_BY_JUMPS, OPTIMIZED_BY_NONE, OPTIMIZED_BY_TIME, and REVERSE_CASE.

Referenced by SystemInfoRouteToSystem().

+ Here is the caller graph for this function: