Oolite
Loading...
Searching...
No Matches
OOConstToString.m File Reference
import "OOConstToString.h"
import "OOCollectionExtractors.h"
#include <jsapi.h>
import "OOEquipmentType.h"
import "PlayerEntity.h"
import "Universe.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)
NSString * OOStringFromHDRToneMapper (OOHDRToneMapper toneMapper)
OOHDRToneMapper OOHDRToneMapperFromString (NSString *string)
NSString * OOStringFromSDRToneMapper (OOSDRToneMapper toneMapper)
OOSDRToneMapper OOSDRToneMapperFromString (NSString *string)

Macro Definition Documentation

◆ CASE

#define CASE ( foo)

◆ DIFF_STRING_ENTRY

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

Definition at line 48 of file OOConstToString.m.

48#define DIFF_STRING_ENTRY(label, string) \
49 case label: \
50 return @string;

◆ ENTRY [1/2]

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

Definition at line 42 of file OOConstToString.m.

42#define ENTRY(label, value) \
43 case label: \
44 return @ #label;

◆ ENTRY [2/2]

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

Definition at line 42 of file OOConstToString.m.

42#define ENTRY(label, value) \
43 case label: \
44 return @ #label;

◆ GALACTIC_HYPERSPACE_ENTRY [1/2]

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

Definition at line 45 of file OOConstToString.m.

45#define GALACTIC_HYPERSPACE_ENTRY(label, value) \
46 case GALACTIC_HYPERSPACE_##label: \
47 return @ #label;

◆ GALACTIC_HYPERSPACE_ENTRY [2/2]

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

Definition at line 45 of file OOConstToString.m.

45#define GALACTIC_HYPERSPACE_ENTRY(label, value) \
46 case GALACTIC_HYPERSPACE_##label: \
47 return @ #label;

◆ REVERSE_CASE

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

Definition at line 38 of file OOConstToString.m.

38#define REVERSE_CASE(foo) \
39 if ([string isEqualToString:@ #foo]) \
40 return foo;

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

Function Documentation

◆ CargoTypeToString()

NSString * CargoTypeToString ( OOCargoType cargo)

Definition at line 316 of file OOConstToString.m.

317{
318 switch (cargo) {
327 }
328 return @"Unknown cargo";
329}
#define CASE(foo)
@ CARGO_RANDOM
Definition OOTypes.h:66
@ CARGO_NOT_CARGO
Definition OOTypes.h:61
@ CARGO_THARGOID
Definition OOTypes.h:65
@ CARGO_CHARACTER
Definition OOTypes.h:68
@ CARGO_SLAVES
Definition OOTypes.h:62
@ CARGO_ALLOY
Definition OOTypes.h:63
@ CARGO_SCRIPTED_ITEM
Definition OOTypes.h:67
@ CARGO_MINERALS
Definition OOTypes.h:64

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 478 of file OOConstToString.m.

479{
480 return CommodityDisplayNameForSymbolicName([commodityDefinition oo_stringAtIndex:MARKET_NAME]);
481}
NSString * CommodityDisplayNameForSymbolicName(NSString *symbolicName)
@ MARKET_NAME
Definition Universe.h:61

References CommodityDisplayNameForSymbolicName(), and MARKET_NAME.

Here is the call graph for this function:

◆ CommodityDisplayNameForSymbolicName()

NSString * CommodityDisplayNameForSymbolicName ( NSString * symbolicName)

Definition at line 472 of file OOConstToString.m.

473{
474 NSString* ret = [UNIVERSE descriptionForKey:[@"commodity-name " stringByAppendingString:[symbolicName lowercaseString]]];
475 return ret ? ret : symbolicName;
476}

Referenced by CommodityDisplayNameForCommodityArray(), GlobalDisplayNameForCommodity(), and GlobalDisplayNameForCommodity().

Here is the caller graph for this function:

◆ DisplayStringForMassUnit()

NSString * DisplayStringForMassUnit ( OOMassUnit unit)

Definition at line 483 of file OOConstToString.m.

484{
485 switch (unit) {
486 case UNITS_TONS:
487 return DESC(@"cargo-tons-symbol");
488 case UNITS_KILOGRAMS:
489 return DESC(@"cargo-kilograms-symbol");
490 case UNITS_GRAMS:
491 return DESC(@"cargo-grams-symbol");
492 }
493
494 return @"??";
495}
@ UNITS_TONS
Definition OOTypes.h:112
@ UNITS_GRAMS
Definition OOTypes.h:114
@ UNITS_KILOGRAMS
Definition OOTypes.h:113
#define DESC(key)
Definition Universe.h:832

References DESC, UNITS_GRAMS, UNITS_KILOGRAMS, and UNITS_TONS.

Referenced by DisplayStringForMassUnitForCommodity(), and PlayerEntity(OOPrivate)::showMarketScreenDataLine:forGood:inMarket:holdQuantity:.

Here is the caller graph for this function:

◆ DisplayStringForMassUnitForCommodity()

NSString * DisplayStringForMassUnitForCommodity ( OOCommodityType commodity)

Definition at line 497 of file OOConstToString.m.

498{
499 return DisplayStringForMassUnit([[UNIVERSE commodityMarket] massUnitForGood:commodity]);
500}
NSString * DisplayStringForMassUnit(OOMassUnit unit)
#define UNIVERSE
Definition Universe.h:827

References DisplayStringForMassUnit(), and UNIVERSE.

Here is the call graph for this function:

◆ DockingClearanceStatusToString()

NSString * DockingClearanceStatusToString ( OODockingClearanceStatus dockingClearanceStatus)

Definition at line 511 of file OOConstToString.m.

512{
513 switch (dockingClearanceStatus) {
519 }
520
521 return @"DOCKING_CLEARANCE_STATUS_UNKNOWN";
522}
@ DOCKING_CLEARANCE_STATUS_TIMING_OUT
Definition OOTypes.h:152
@ DOCKING_CLEARANCE_STATUS_NOT_REQUIRED
Definition OOTypes.h:149
@ DOCKING_CLEARANCE_STATUS_GRANTED
Definition OOTypes.h:151
@ DOCKING_CLEARANCE_STATUS_NONE
Definition OOTypes.h:148
@ DOCKING_CLEARANCE_STATUS_REQUESTED
Definition OOTypes.h:150

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(), and PlayerGetProperty().

Here is the caller graph for this function:

◆ EnergyUnitTypeToString()

NSString * EnergyUnitTypeToString ( OOEnergyUnitType unit)

Definition at line 349 of file OOConstToString.m.

350{
351 switch (unit) {
357
360 break;
361 }
362
363 return @"Unsupported energy unit";
364}
@ ENERGY_UNIT_NORMAL
Definition OOTypes.h:123
@ ENERGY_UNIT_NAVAL_DAMAGED
Definition OOTypes.h:120
@ ENERGY_UNIT_NAVAL
Definition OOTypes.h:124
@ OLD_ENERGY_UNIT_NORMAL
Definition OOTypes.h:121
@ ENERGY_UNIT_NONE
Definition OOTypes.h:118
@ OLD_ENERGY_UNIT_NAVAL
Definition OOTypes.h:122
@ ENERGY_UNIT_NORMAL_DAMAGED
Definition OOTypes.h:119

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 236 of file OOConstToString.m.

237{
238 switch ((JSType)type) {
239 CASE(JSTYPE_VOID);
240 CASE(JSTYPE_OBJECT);
241 CASE(JSTYPE_FUNCTION);
242 CASE(JSTYPE_STRING);
243 CASE(JSTYPE_NUMBER);
244 CASE(JSTYPE_BOOLEAN);
245 CASE(JSTYPE_NULL);
246 CASE(JSTYPE_XML);
247 CASE(JSTYPE_LIMIT);
248 }
249 return [NSString stringWithFormat:@"unknown (%u)", type];
250}

References CASE.

◆ KillCountToRatingAndKillString()

NSString * KillCountToRatingAndKillString ( unsigned kills)

Definition at line 403 of file OOConstToString.m.

404{
405 return [NSString stringWithFormat:@"%@ (%u)", OODisplayRatingStringFromKillCount(kills), kills];
406}

Referenced by PlayerEntity::setGuiToStatusScreen, and PlayerEntity(OOLoadSavePrivate)::showCommanderShip:.

Here is the caller graph for this function:

◆ OOCompassModeFromString()

OOCompassMode OOCompassModeFromString ( NSString * string)

Definition at line 149 of file OOConstToString.m.

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

References kOOCompassModeDefault.

◆ OODisplayRatingStringFromKillCount()

NSString * OODisplayRatingStringFromKillCount ( unsigned kills)

Definition at line 377 of file OOConstToString.m.

378{
379 enum { kRatingCount = 9 };
380
381 NSArray* ratingNames = nil;
382 const unsigned killThresholds[kRatingCount - 1] = {
383 0x0008,
384 0x0010,
385 0x0020,
386 0x0040,
387 0x0080,
388 0x0200,
389 0x0A00,
390 0x1900
391 };
392 unsigned i;
393
394 ratingNames = [[UNIVERSE descriptions] oo_arrayForKey:@"rating"];
395 for (i = 0; i < kRatingCount - 1; ++i) {
396 if (kills < killThresholds[i])
397 return [ratingNames oo_stringAtIndex:i];
398 }
399
400 return [ratingNames oo_stringAtIndex:kRatingCount - 1];
401}
return nil

References nil.

Referenced by PlayerEntity(Scripting)::commanderRank_string, PlayerEntity(OOLoadSavePrivate)::lsCommanders:directory:pageNumber:highlightName:, PlayerGetProperty(), and PlayerGetProperty().

Here is the caller graph for this function:

◆ OODisplayStringFromAlertCondition()

NSString * OODisplayStringFromAlertCondition ( OOAlertCondition alertCondition)

Definition at line 428 of file OOConstToString.m.

429{
430 NSArray* conditionNames = [[UNIVERSE descriptions] oo_arrayForKey:@"condition"];
431 return [conditionNames oo_stringAtIndex:alertCondition];
432}

Referenced by PlayerEntity::setGuiToStatusScreen.

Here is the caller graph for this function:

◆ OODisplayStringFromEconomyID()

NSString * OODisplayStringFromEconomyID ( OOEconomyID economy)

Definition at line 220 of file OOConstToString.m.

221{
222 NSArray* strings = nil;
223 NSString* value = nil;
224
225 strings = [[UNIVERSE descriptions] objectForKey:@"economy"];
226 if ([strings isKindOfClass:[NSArray class]] && economy < [strings count]) {
227 value = [strings objectAtIndex:economy];
228 if ([value isKindOfClass:[NSString class]])
229 return value;
230 }
231
232 return nil;
233}
unsigned count

References count, and nil.

Referenced by PlayerEntity(Scripting)::systemEconomy_string, SystemGetProperty(), and SystemGetProperty().

Here is the caller graph for this function:

◆ OODisplayStringFromGovernmentID()

NSString * OODisplayStringFromGovernmentID ( OOGovernmentID government)

Definition at line 205 of file OOConstToString.m.

206{
207 NSArray* strings = nil;
208 NSString* value = nil;
209
210 strings = [[UNIVERSE descriptions] objectForKey:@"government"];
211 if ([strings isKindOfClass:[NSArray class]] && government < [strings count]) {
212 value = [strings objectAtIndex:government];
213 if ([value isKindOfClass:[NSString class]])
214 return value;
215 }
216
217 return nil;
218}

References count, and nil.

Referenced by SystemGetProperty(), SystemGetProperty(), and PlayerEntity(Scripting)::systemGovernment_string.

Here is the caller graph for this function:

◆ OODisplayStringFromLegalStatus()

NSString * OODisplayStringFromLegalStatus ( int legalStatus)

Definition at line 408 of file OOConstToString.m.

409{
410 enum { kStatusCount = 3 };
411
412 NSArray* statusNames = nil;
413 const int statusThresholds[kStatusCount - 1] = {
414 1,
415 51
416 };
417 unsigned i;
418
419 statusNames = [[UNIVERSE descriptions] oo_arrayForKey:@"legal_status"];
420 for (i = 0; i != kStatusCount - 1; ++i) {
421 if (legalStatus < statusThresholds[i])
422 return [statusNames oo_stringAtIndex:i];
423 }
424
425 return [statusNames oo_stringAtIndex:kStatusCount - 1];
426}

References nil.

Referenced by PlayerEntity(Scripting)::commanderLegalStatus_string, PlayerGetProperty(), PlayerGetProperty(), PlayerEntity::setGuiToStatusScreen, and PlayerEntity(OOLoadSavePrivate)::showCommanderShip:.

Here is the caller graph for this function:

◆ OODisplayStringFromShaderSetting()

NSString * OODisplayStringFromShaderSetting ( OOShaderSetting setting)

Definition at line 434 of file OOConstToString.m.

435{
436 switch (setting) {
438 return DESC(@"shaderfx-not-available");
439 case SHADERS_OFF:
440 return DESC(@"shaderfx-off");
441 case SHADERS_SIMPLE:
442 return DESC(@"shaderfx-simple");
443 case SHADERS_FULL:
444 return DESC(@"shaderfx-full");
445 }
446
447 return @"??";
448}
@ SHADERS_FULL
Definition OOOpenGL.h:38
@ SHADERS_SIMPLE
Definition OOOpenGL.h:37
@ SHADERS_OFF
Definition OOOpenGL.h:36
@ SHADERS_NOT_SUPPORTED
Definition OOOpenGL.h:35

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

◆ OOEntityStatusFromString()

OOEntityStatus OOEntityStatusFromString ( NSString * string)

Definition at line 142 of file OOConstToString.m.

143{
144#include "OOEntityStatus.tbl"
145
147}
@ kOOEntityStatusDefault
Definition Entity.h:326

References kOOEntityStatusDefault.

◆ OOEquipmentIdentifierFromWeaponType()

NSString * OOEquipmentIdentifierFromWeaponType ( OOWeaponType weapon)

Definition at line 267 of file OOConstToString.m.

268{
269 return [weapon identifier];
270}
NSString * identifier()

References OOEquipmentType::identifier.

Referenced by Universe::tradeInValueForCommanderDictionary:.

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

◆ OOGalacticHyperspaceBehaviourFromString()

OOGalacticHyperspaceBehaviour OOGalacticHyperspaceBehaviourFromString ( NSString * string)

Definition at line 156 of file OOConstToString.m.

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

References kOOGalacticHyperspaceBehaviourDefault, and OOGalacticHyperspaceBehaviourFromString().

Referenced by OOGalacticHyperspaceBehaviourFromString(), and PlayerEntity(Scripting)::setGalacticHyperspaceBehaviourTo:.

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

◆ OOGraphicsDetailFromString()

OOGraphicsDetail OOGraphicsDetailFromString ( NSString * string)

Definition at line 536 of file OOConstToString.m.

537{
542
544}
#define REVERSE_CASE(foo)
@ DETAIL_LEVEL_EXTRAS
Definition OOTypes.h:212
@ DETAIL_LEVEL_SHADERS
Definition OOTypes.h:211
@ DETAIL_LEVEL_MINIMUM
Definition OOTypes.h:209
@ DETAIL_LEVEL_NORMAL
Definition OOTypes.h:210

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

◆ OOGUIScreenIDFromString()

OOGUIScreenID OOGUIScreenIDFromString ( NSString * string)

Definition at line 170 of file OOConstToString.m.

171{
172#include "OOGUIScreenID.tbl"
173
175}
@ kOOGUIScreenIDDefault

References kOOGUIScreenIDDefault.

◆ OOHDRToneMapperFromString()

OOHDRToneMapper OOHDRToneMapperFromString ( NSString * string)

Definition at line 559 of file OOConstToString.m.

References OOHDR_TONEMAPPER_ACES_APPROX, OOHDR_TONEMAPPER_DICE, OOHDR_TONEMAPPER_NONE, OOHDR_TONEMAPPER_REINHARD, OOHDR_TONEMAPPER_UCHIMURA, and REVERSE_CASE.

Referenced by MyOpenGLView::createWindowWithSize:.

Here is the caller graph for this function:

◆ OOLongRangeChartModeFromString()

OOLongRangeChartMode OOLongRangeChartModeFromString ( NSString * string)

Definition at line 184 of file OOConstToString.m.

185{
186#include "OOLongRangeChartMode.tbl"
187
189}
@ kOOLongRangeChartModeDefault
Definition OOTypes.h:48

References kOOLongRangeChartModeDefault.

Referenced by PlayerShipSetProperty(), and PlayerShipSetProperty().

Here is the caller graph for this function:

◆ OOScanClassFromString()

OOScanClass OOScanClassFromString ( NSString * string)

Definition at line 177 of file OOConstToString.m.

178{
179#include "OOScanClass.tbl"
180
181 return kOOScanClassDefault;
182}
@ kOOScanClassDefault
Definition Entity.h:327

References kOOScanClassDefault.

Referenced by ShipEntity::setUpShipFromDictionary:.

Here is the caller graph for this function:

◆ OOSDRToneMapperFromString()

OOSDRToneMapper OOSDRToneMapperFromString ( NSString * string)

Definition at line 585 of file OOConstToString.m.

References OOSDR_TONEMAPPER_ACES, OOSDR_TONEMAPPER_AgX, OOSDR_TONEMAPPER_HEJLDAWSON, OOSDR_TONEMAPPER_NONE, OOSDR_TONEMAPPER_REINHARD, OOSDR_TONEMAPPER_UC2, OOSDR_TONEMAPPER_UCHIMURA, and REVERSE_CASE.

Referenced by MyOpenGLView::createWindowWithSize:.

Here is the caller graph for this function:

◆ OOShaderSettingFromString()

OOShaderSetting OOShaderSettingFromString ( NSString * string)

Definition at line 462 of file OOConstToString.m.

References kOOShaderSettingDefault, REVERSE_CASE, SHADERS_FULL, SHADERS_NOT_SUPPORTED, SHADERS_OFF, and SHADERS_SIMPLE.

Referenced by OOOpenGLExtensionManager::reset.

Here is the caller graph for this function:

◆ OOStringFromBehaviour()

NSString * OOStringFromBehaviour ( OOBehaviour value)

Definition at line 60 of file OOConstToString.m.

61{
62 switch (value) {
63#include "OOBehaviour.tbl"
64 }
65
66 return @"** BEHAVIOUR UNKNOWN **";
67}

Referenced by ShipEntity::update:.

Here is the caller graph for this function:

◆ OOStringFromCompassMode()

NSString * OOStringFromCompassMode ( OOCompassMode value)

Definition at line 69 of file OOConstToString.m.

70{
71 switch (value) {
72#include "OOCompassMode.tbl"
73 }
74
75 return @"UNDEFINED";
76}

◆ OOStringFromEntityStatus()

NSString * OOStringFromEntityStatus ( OOEntityStatus value)

Definition at line 52 of file OOConstToString.m.

53{
54 switch (value) {
55#include "OOEntityStatus.tbl"
56 }
57 return @"UNDEFINED";
58}

Referenced by Entity::dumpSelfState, PlayerEntity::isDocked, and PlayerEntity(Scripting)::status_string.

Here is the caller graph for this function:

◆ OOStringFromGalacticHyperspaceBehaviour()

NSString * OOStringFromGalacticHyperspaceBehaviour ( OOGalacticHyperspaceBehaviour value)

Definition at line 87 of file OOConstToString.m.

88{
89 switch (value) {
90#include "OOGalacticHyperspaceBehaviour.tbl"
91 }
92
93 return @"UNDEFINED";
94}

◆ OOStringFromGraphicsDetail()

NSString * OOStringFromGraphicsDetail ( OOGraphicsDetail detail)

Definition at line 524 of file OOConstToString.m.

525{
526 switch (detail) {
531 }
532
533 return @"DETAIL_LEVEL_UNKNOWN";
534}

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

Referenced by Universe::setDetailLevel:.

Here is the caller graph for this function:

◆ OOStringFromGUIScreenID()

NSString * OOStringFromGUIScreenID ( OOGUIScreenID value)

Definition at line 96 of file OOConstToString.m.

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

Referenced by PlayerEntity(Scripting)::gui_screen_string.

Here is the caller graph for this function:

◆ OOStringFromHDRToneMapper()

NSString * OOStringFromHDRToneMapper ( OOHDRToneMapper toneMapper)

Definition at line 546 of file OOConstToString.m.

547{
548 switch (toneMapper) {
554 }
555
556 return @"OOHDR_TONEMAPPER_UNDEFINED";
557}

References CASE, OOHDR_TONEMAPPER_ACES_APPROX, OOHDR_TONEMAPPER_DICE, OOHDR_TONEMAPPER_NONE, OOHDR_TONEMAPPER_REINHARD, and OOHDR_TONEMAPPER_UCHIMURA.

Referenced by OoliteGetProperty(), and OoliteGetProperty().

Here is the caller graph for this function:

◆ OOStringFromLegalStatusReason()

NSString * OOStringFromLegalStatusReason ( OOLegalStatusReason value)

Definition at line 123 of file OOConstToString.m.

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

Referenced by PlayerEntity::setBounty:withReason:, and ShipEntity::setBounty:withReason:.

Here is the caller graph for this function:

◆ OOStringFromLongRangeChartMode()

NSString * OOStringFromLongRangeChartMode ( OOLongRangeChartMode value)

Definition at line 78 of file OOConstToString.m.

79{
80 switch (value) {
81#include "OOLongRangeChartMode.tbl"
82 }
83
84 return @"UNDEFINED";
85}

Referenced by PlayerShipGetProperty(), and PlayerShipGetProperty().

Here is the caller graph for this function:

◆ OOStringFromScanClass()

NSString * OOStringFromScanClass ( OOScanClass value)

Definition at line 105 of file OOConstToString.m.

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

Referenced by Entity::dumpSelfState.

Here is the caller graph for this function:

◆ OOStringFromSDRToneMapper()

NSString * OOStringFromSDRToneMapper ( OOSDRToneMapper toneMapper)

Definition at line 570 of file OOConstToString.m.

571{
572 switch (toneMapper) {
580 }
581
582 return @"OOSDR_TONEMAPPER_UNDEFINED";
583}

References CASE, OOSDR_TONEMAPPER_ACES, OOSDR_TONEMAPPER_AgX, OOSDR_TONEMAPPER_HEJLDAWSON, OOSDR_TONEMAPPER_NONE, OOSDR_TONEMAPPER_REINHARD, OOSDR_TONEMAPPER_UC2, and OOSDR_TONEMAPPER_UCHIMURA.

Referenced by OoliteGetProperty(), and OoliteGetProperty().

Here is the caller graph for this function:

◆ OOStringFromShaderSetting()

NSString * OOStringFromShaderSetting ( OOShaderSetting setting)

Definition at line 450 of file OOConstToString.m.

451{
452 switch (setting) {
457 }
458
459 return @"UNDEFINED";
460}

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

◆ OOStringFromShipDamageType()

NSString * OOStringFromShipDamageType ( OOShipDamageType value)

Definition at line 114 of file OOConstToString.m.

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

Referenced by PlayerEntity::getDestroyedBy:damageType:.

Here is the caller graph for this function:

◆ OOStringFromWeaponType()

NSString * OOStringFromWeaponType ( OOWeaponType weapon)

Definition at line 253 of file OOConstToString.m.

254{
255 if (weapon == nil) {
256 return @"EQ_WEAPON_NONE";
257 } else {
258 return [weapon identifier];
259 }
260}

References OOEquipmentType::identifier, and nil.

Referenced by HeadUpDisplay(Private)::crosshairDefinitionForWeaponType:.

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

◆ OOWeaponTypeFromEquipmentIdentifierLegacy()

OOWeaponType OOWeaponTypeFromEquipmentIdentifierLegacy ( NSString * string)

Definition at line 289 of file OOConstToString.m.

290{
291 if ([string intValue] > 0) {
292 switch ([string intValue]) {
293 case 2:
294 return OOWeaponTypeFromEquipmentIdentifierSloppy(@"EQ_WEAPON_PULSE_LASER");
295 case 3:
296 return OOWeaponTypeFromEquipmentIdentifierSloppy(@"EQ_WEAPON_BEAM_LASER");
297 case 4:
298 return OOWeaponTypeFromEquipmentIdentifierSloppy(@"EQ_WEAPON_MINING_LASER");
299 case 5:
300 return OOWeaponTypeFromEquipmentIdentifierSloppy(@"EQ_WEAPON_MILITARY_LASER");
301 case 10:
302 return OOWeaponTypeFromEquipmentIdentifierSloppy(@"EQ_WEAPON_THARGOID_LASER");
303 default:
305 }
306 }
308}
OOWeaponType OOWeaponTypeFromEquipmentIdentifierSloppy(NSString *string)

References OOWeaponTypeFromEquipmentIdentifierSloppy().

Referenced by PlayerEntity::setCommanderDataFromDictionary:.

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

◆ OOWeaponTypeFromEquipmentIdentifierSloppy()

OOWeaponType OOWeaponTypeFromEquipmentIdentifierSloppy ( NSString * string)

Definition at line 272 of file OOConstToString.m.

273{
275 if (w == nil) {
276 if (![string hasPrefix:@"EQ_"]) {
277 w = [OOEquipmentType equipmentTypeWithIdentifier:[NSString stringWithFormat:@"EQ_%@", string]];
278 if (w != nil) {
279 return w;
280 }
281 }
282 return [OOEquipmentType equipmentTypeWithIdentifier:@"EQ_WEAPON_NONE"];
283 }
284 return w;
285}
OOEquipmentType * OOWeaponType
Definition ShipEntity.h:164
OOEquipmentType * equipmentTypeWithIdentifier:(NSString *identifier)

References OOEquipmentType::equipmentTypeWithIdentifier:, and nil.

Referenced by ShipEntity::behaviour_attack_target:, PlayerEntity(Contracts)::newShipCommonSetup:yardInfo:baseInfo:, OOWeaponTypeFromEquipmentIdentifierLegacy(), OOWeaponTypeFromEquipmentIdentifierStrict(), OOWeaponTypeFromString(), PlayerEntity(OOControlsPrivate)::pollGuiArrowKeyControls:, PlayerEntity::setCommanderDataFromDictionary:, Universe::shipsForSaleForSystem:withTL:atTime:, StationAddShipToShipyard(), 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 310 of file OOConstToString.m.

311{
312 // there is no difference between the two any more
314}

References OOWeaponTypeFromEquipmentIdentifierSloppy().

Referenced by ShipEntity::hasOneEquipmentItem:includeWeapons:whileLoading:, ShipEntity::setWeaponMount:toWeapon:, PlayerEntity::setWeaponMount:toWeapon:inContext:, and PlayerEntity(OOPrivate)::tryBuyingItem:.

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

◆ OOWeaponTypeFromString()

OOWeaponType OOWeaponTypeFromString ( NSString * string)

Definition at line 262 of file OOConstToString.m.

263{
265}

References OOWeaponTypeFromEquipmentIdentifierSloppy().

Here is the call graph for this function:

◆ RouteTypeToString()

NSString * RouteTypeToString ( OORouteType routeType)

Definition at line 194 of file OOConstToString.m.

195{
196 switch (routeType) {
200 }
201
202 return @"** ROUTE TYPE UNKNOWN **";
203}
@ OPTIMIZED_BY_NONE
Definition OOTypes.h:32
@ OPTIMIZED_BY_JUMPS
Definition OOTypes.h:33
@ OPTIMIZED_BY_TIME
Definition OOTypes.h:34

References CASE, OPTIMIZED_BY_JUMPS, OPTIMIZED_BY_NONE, and OPTIMIZED_BY_TIME.

◆ StringToCargoType()

OOCargoType StringToCargoType ( NSString * string)

Definition at line 331 of file OOConstToString.m.

332{
341
342 // Backwards compatibility.
343 if ([string isEqual:@"CARGO_CARRIED"])
344 return CARGO_RANDOM;
345
346 return kOOCargoTypeDefault;
347}
@ kOOCargoTypeDefault

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

Referenced by ShipEntity::setUpCargoType:.

Here is the caller graph for this function:

◆ StringToEnergyUnitType()

◆ StringToRouteType()

OORouteType StringToRouteType ( NSString * string)

Definition at line 502 of file OOConstToString.m.

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

Referenced by SystemInfoRouteToSystem(), and SystemInfoRouteToSystem().

Here is the caller graph for this function: