Oolite 1.91.0.7645-241119-222d325
Loading...
Searching...
No Matches
OOConstToString.h File Reference
import <Foundation/Foundation.h>
import "OOFunctionAttributes.h"
import "OOTypes.h"
+ Include dependency graph for OOConstToString.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  { kOOCargoTypeDefault = CARGO_NOT_CARGO , kOOEnergyUnitTypeDefault = ENERGY_UNIT_NONE , kOORouteTypeDefault = OPTIMIZED_BY_JUMPS }
 

Functions

NSString * JSTypeToString (int type) CONST_FUNC
 
NSString * CargoTypeToString (OOCargoType cargo) CONST_FUNC
 
OOCargoType StringToCargoType (NSString *string) PURE_FUNC
 
NSString * EnergyUnitTypeToString (OOEnergyUnitType unit) CONST_FUNC
 
OOEnergyUnitType StringToEnergyUnitType (NSString *string) PURE_FUNC
 
NSString * CommodityDisplayNameForSymbolicName (NSString *symbolicName)
 
NSString * CommodityDisplayNameForCommodityArray (NSArray *commodityDefinition)
 
NSString * DisplayStringForMassUnit (OOMassUnit unit)
 
NSString * DisplayStringForMassUnitForCommodity (OOCommodityType commodity)
 
NSString * OOStringFromCompassMode (OOCompassMode mode)
 
OOCompassMode OOCompassModeFromString (NSString *string)
 
NSString * OOStringFromLongRangeChartMode (OOLongRangeChartMode chartMode)
 
OOLongRangeChartMode OOLongRangeChartModeFromString (NSString *string)
 
NSString * OOStringFromLegalStatusReason (OOLegalStatusReason reason)
 
NSString * RouteTypeToString (OORouteType routeType)
 
OORouteType StringToRouteType (NSString *string)
 
NSString * DockingClearanceStatusToString (OODockingClearanceStatus dockingClearanceStatus) PURE_FUNC
 
NSString * OOStringFromGraphicsDetail (OOGraphicsDetail detail)
 
OOGraphicsDetail OOGraphicsDetailFromString (NSString *string)
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kOOCargoTypeDefault 
kOOEnergyUnitTypeDefault 
kOORouteTypeDefault 

Definition at line 36 of file OOConstToString.h.

37{
38 // Values used for unknown strings.
40// kOOCommodityTypeDefault = COMMODITY_UNDEFINED,
43};
@ kOOCargoTypeDefault
@ kOORouteTypeDefault
@ kOOEnergyUnitTypeDefault
@ OPTIMIZED_BY_JUMPS
Definition OOTypes.h:35
@ CARGO_NOT_CARGO
Definition OOTypes.h:70
@ ENERGY_UNIT_NONE
Definition OOTypes.h:132

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_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}
#define UNIVERSE
Definition Universe.h:833

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)

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
@ 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.

◆ 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.

◆ 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.

◆ 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:

◆ OOStringFromCompassMode()

NSString * OOStringFromCompassMode ( OOCompassMode mode)

Definition at line 62 of file OOConstToString.m.

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

◆ 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.

◆ OOStringFromLegalStatusReason()

NSString * OOStringFromLegalStatusReason ( OOLegalStatusReason reason)

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 chartMode)

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:

◆ 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_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: