Oolite 1.91.0.7646-241128-10e222e
Loading...
Searching...
No Matches
Universe.h File Reference
import "OOCocoa.h"
import "OOOpenGL.h"
import "OOShaderProgram.h"
import "legacy_random.h"
import "OOMaths.h"
import "OOColor.h"
import "OOWeakReference.h"
import "OOTypes.h"
import "OOSound.h"
import "OOJSPropID.h"
import "OOStellarBody.h"
import "OOEntityWithDrawable.h"
import "OOCommodities.h"
import "OOSystemDescriptionManager.h"
+ Include dependency graph for Universe.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Universe
 
category  OOSound(OOCustomSounds)
 
category  OOSoundSource(OOCustomSounds)
 

Macros

#define OO_SCANCLASS_TYPE
 
#define CROSSHAIR_SIZE   32.0
 
#define SHADERS_MIN   SHADERS_OFF
 
#define MAX_MESSAGES   5
 
#define PROXIMITY_WARN_DISTANCE   4
 
#define PROXIMITY_WARN_DISTANCE2   (PROXIMITY_WARN_DISTANCE * PROXIMITY_WARN_DISTANCE)
 
#define PROXIMITY_AVOID_DISTANCE_FACTOR   10.0
 
#define SAFE_ADDITION_FACTOR2   800
 
#define SUN_SKIM_RADIUS_FACTOR   1.15470053838
 
#define SUN_SPARKS_RADIUS_FACTOR   2.0
 
#define KEY_TECHLEVEL   @"techlevel"
 
#define KEY_ECONOMY   @"economy"
 
#define KEY_ECONOMY_DESC   @"economy_description"
 
#define KEY_GOVERNMENT   @"government"
 
#define KEY_GOVERNMENT_DESC   @"government_description"
 
#define KEY_POPULATION   @"population"
 
#define KEY_POPULATION_DESC   @"population_description"
 
#define KEY_PRODUCTIVITY   @"productivity"
 
#define KEY_RADIUS   @"radius"
 
#define KEY_NAME   @"name"
 
#define KEY_INHABITANT   @"inhabitant"
 
#define KEY_INHABITANTS   @"inhabitants"
 
#define KEY_DESCRIPTION   @"description"
 
#define KEY_SHORT_DESCRIPTION   @"short_description"
 
#define KEY_PLANETNAME   @"planet_name"
 
#define KEY_SUNNAME   @"sun_name"
 
#define KEY_CHANCE   @"chance"
 
#define KEY_PRICE   @"price"
 
#define KEY_OPTIONAL_EQUIPMENT   @"optional_equipment"
 
#define KEY_STANDARD_EQUIPMENT   @"standard_equipment"
 
#define KEY_EQUIPMENT_MISSILES   @"missiles"
 
#define KEY_EQUIPMENT_FORWARD_WEAPON   @"forward_weapon_type"
 
#define KEY_EQUIPMENT_AFT_WEAPON   @"aft_weapon_type"
 
#define KEY_EQUIPMENT_PORT_WEAPON   @"port_weapon_type"
 
#define KEY_EQUIPMENT_STARBOARD_WEAPON   @"starboard_weapon_type"
 
#define KEY_EQUIPMENT_EXTRAS   @"extras"
 
#define KEY_WEAPON_FACINGS   @"weapon_facings"
 
#define KEY_RENOVATION_MULTIPLIER   @"renovation_multiplier"
 
#define SHIPYARD_KEY_ID   @"id"
 
#define SHIPYARD_KEY_SHIPDATA_KEY   @"shipdata_key"
 
#define SHIPYARD_KEY_SHIP   @"ship"
 
#define SHIPYARD_KEY_PRICE   @"price"
 
#define SHIPYARD_KEY_PERSONALITY   @"personality"
 
#define PASSENGER_BERTH_SPACE   5
 
#define PLANETINFO_UNIVERSAL_KEY   @"universal"
 
#define PLANETINFO_INTERSTELLAR_KEY   @"interstellar space"
 
#define OOLITE_EXCEPTION_LOOPING   @"OoliteLoopingException"
 
#define OOLITE_EXCEPTION_DATA_NOT_FOUND   @"OoliteDataNotFoundException"
 
#define OOLITE_EXCEPTION_FATAL   @"OoliteFatalException"
 
#define BILLBOARD_DEPTH   75000.0
 
#define TIME_ACCELERATION_FACTOR_MIN   0.0625f
 
#define TIME_ACCELERATION_FACTOR_DEFAULT   1.0f
 
#define TIME_ACCELERATION_FACTOR_MAX   16.0f
 
#define DEMO_LIGHT_POSITION   5000.0f, 25000.0f, -10000.0f
 
#define MIN_DISTANCE_TO_BUOY   750.0f
 
#define MIN_DISTANCE_TO_BUOY2   (MIN_DISTANCE_TO_BUOY * MIN_DISTANCE_TO_BUOY)
 
#define SYSTEM_REPOPULATION_INTERVAL   20.0f;
 
#define OO_LOCALIZATION_TOOLS   1
 
#define MASS_DEPENDENT_FUEL_PRICES   1
 
#define UNIVERSE   OOGetUniverse()
 
#define DESC(key)
 
#define DESC_PLURAL(key, count)
 

Typedefs

typedef BOOL(* EntityFilterPredicate) (Entity *entity, void *parameter)
 

Enumerations

enum  {
  MARKET_NAME = 0 , MARKET_QUANTITY = 1 , MARKET_PRICE = 2 , MARKET_BASE_PRICE = 3 ,
  MARKET_ECO_ADJUST_PRICE = 4 , MARKET_ECO_ADJUST_QUANTITY = 5 , MARKET_BASE_QUANTITY = 6 , MARKET_MASK_PRICE = 7 ,
  MARKET_MASK_QUANTITY = 8 , MARKET_UNITS = 9
}
 
enum  {
  EQUIPMENT_TECH_LEVEL_INDEX = 0 , EQUIPMENT_PRICE_INDEX = 1 , EQUIPMENT_SHORT_DESC_INDEX = 2 , EQUIPMENT_KEY_INDEX = 3 ,
  EQUIPMENT_LONG_DESC_INDEX = 4 , EQUIPMENT_EXTRA_INFO_INDEX = 5
}
 
enum  {
  OO_POSTFX_NONE = 0 , OO_POSTFX_COLORBLINDNESS_PROTAN , OO_POSTFX_COLORBLINDNESS_DEUTER , OO_POSTFX_COLORBLINDNESS_TRITAN ,
  OO_POSTFX_CLOAK , OO_POSTFX_GRAYSCALE , OO_POSTFX_OLDMOVIE , OO_POSTFX_CRT ,
  OO_POSTFX_CRTBADSIGNAL , OO_POSTFX_ENDOFLIST
}
 

Functions

OOINLINE UniverseOOGetUniverse (void) INLINE_CONST_FUNC
 
NSComparisonResult populatorPrioritySort (id a, id b, void *context)
 
NSComparisonResult equipmentSort (id a, id b, void *context)
 
NSComparisonResult equipmentSortOutfitting (id a, id b, void *context)
 
NSString * OOLookUpDescriptionPRIV (NSString *key)
 
NSString * OOLookUpPluralDescriptionPRIV (NSString *key, NSInteger count)
 
NSString * OODisplayStringFromGovernmentID (OOGovernmentID government)
 
NSString * OODisplayStringFromEconomyID (OOEconomyID economy)
 

Macro Definition Documentation

◆ BILLBOARD_DEPTH

#define BILLBOARD_DEPTH   75000.0

Definition at line 163 of file Universe.h.

◆ CROSSHAIR_SIZE

#define CROSSHAIR_SIZE   32.0

Definition at line 60 of file Universe.h.

◆ DEMO_LIGHT_POSITION

#define DEMO_LIGHT_POSITION   5000.0f, 25000.0f, -10000.0f

Definition at line 169 of file Universe.h.

◆ DESC

◆ DESC_PLURAL

#define DESC_PLURAL ( key,
count )
Value:
unsigned count
NSString * OOLookUpPluralDescriptionPRIV(NSString *key, NSInteger count)
Definition Universe.m:11177

Definition at line 847 of file Universe.h.

◆ KEY_CHANCE

#define KEY_CHANCE   @"chance"

Definition at line 133 of file Universe.h.

◆ KEY_DESCRIPTION

#define KEY_DESCRIPTION   @"description"

Definition at line 128 of file Universe.h.

◆ KEY_ECONOMY

#define KEY_ECONOMY   @"economy"

Definition at line 117 of file Universe.h.

Referenced by SystemGetProperty().

◆ KEY_ECONOMY_DESC

#define KEY_ECONOMY_DESC   @"economy_description"

Definition at line 118 of file Universe.h.

◆ KEY_EQUIPMENT_AFT_WEAPON

#define KEY_EQUIPMENT_AFT_WEAPON   @"aft_weapon_type"

Definition at line 139 of file Universe.h.

◆ KEY_EQUIPMENT_EXTRAS

#define KEY_EQUIPMENT_EXTRAS   @"extras"

Definition at line 142 of file Universe.h.

◆ KEY_EQUIPMENT_FORWARD_WEAPON

#define KEY_EQUIPMENT_FORWARD_WEAPON   @"forward_weapon_type"

Definition at line 138 of file Universe.h.

◆ KEY_EQUIPMENT_MISSILES

#define KEY_EQUIPMENT_MISSILES   @"missiles"

Definition at line 137 of file Universe.h.

◆ KEY_EQUIPMENT_PORT_WEAPON

#define KEY_EQUIPMENT_PORT_WEAPON   @"port_weapon_type"

Definition at line 140 of file Universe.h.

◆ KEY_EQUIPMENT_STARBOARD_WEAPON

#define KEY_EQUIPMENT_STARBOARD_WEAPON   @"starboard_weapon_type"

Definition at line 141 of file Universe.h.

◆ KEY_GOVERNMENT

#define KEY_GOVERNMENT   @"government"

Definition at line 119 of file Universe.h.

Referenced by SystemGetProperty().

◆ KEY_GOVERNMENT_DESC

#define KEY_GOVERNMENT_DESC   @"government_description"

Definition at line 120 of file Universe.h.

◆ KEY_INHABITANT

#define KEY_INHABITANT   @"inhabitant"

Definition at line 126 of file Universe.h.

◆ KEY_INHABITANTS

#define KEY_INHABITANTS   @"inhabitants"

Definition at line 127 of file Universe.h.

◆ KEY_NAME

#define KEY_NAME   @"name"

Definition at line 125 of file Universe.h.

◆ KEY_OPTIONAL_EQUIPMENT

#define KEY_OPTIONAL_EQUIPMENT   @"optional_equipment"

Definition at line 135 of file Universe.h.

◆ KEY_PLANETNAME

#define KEY_PLANETNAME   @"planet_name"

Definition at line 130 of file Universe.h.

◆ KEY_POPULATION

#define KEY_POPULATION   @"population"

Definition at line 121 of file Universe.h.

Referenced by SystemGetProperty().

◆ KEY_POPULATION_DESC

#define KEY_POPULATION_DESC   @"population_description"

Definition at line 122 of file Universe.h.

◆ KEY_PRICE

#define KEY_PRICE   @"price"

Definition at line 134 of file Universe.h.

◆ KEY_PRODUCTIVITY

#define KEY_PRODUCTIVITY   @"productivity"

Definition at line 123 of file Universe.h.

Referenced by SystemGetProperty().

◆ KEY_RADIUS

#define KEY_RADIUS   @"radius"

Definition at line 124 of file Universe.h.

◆ KEY_RENOVATION_MULTIPLIER

#define KEY_RENOVATION_MULTIPLIER   @"renovation_multiplier"

Definition at line 144 of file Universe.h.

◆ KEY_SHORT_DESCRIPTION

#define KEY_SHORT_DESCRIPTION   @"short_description"

Definition at line 129 of file Universe.h.

Referenced by StationAddShipToShipyard().

◆ KEY_STANDARD_EQUIPMENT

#define KEY_STANDARD_EQUIPMENT   @"standard_equipment"

Definition at line 136 of file Universe.h.

◆ KEY_SUNNAME

#define KEY_SUNNAME   @"sun_name"

Definition at line 131 of file Universe.h.

◆ KEY_TECHLEVEL

#define KEY_TECHLEVEL   @"techlevel"

Definition at line 116 of file Universe.h.

Referenced by SystemGetProperty().

◆ KEY_WEAPON_FACINGS

#define KEY_WEAPON_FACINGS   @"weapon_facings"

Definition at line 143 of file Universe.h.

◆ MASS_DEPENDENT_FUEL_PRICES

#define MASS_DEPENDENT_FUEL_PRICES   1

Definition at line 183 of file Universe.h.

◆ MAX_MESSAGES

#define MAX_MESSAGES   5

Definition at line 106 of file Universe.h.

◆ MIN_DISTANCE_TO_BUOY

#define MIN_DISTANCE_TO_BUOY   750.0f

Definition at line 171 of file Universe.h.

◆ MIN_DISTANCE_TO_BUOY2

#define MIN_DISTANCE_TO_BUOY2   (MIN_DISTANCE_TO_BUOY * MIN_DISTANCE_TO_BUOY)

Definition at line 172 of file Universe.h.

◆ OO_LOCALIZATION_TOOLS

#define OO_LOCALIZATION_TOOLS   1

Definition at line 179 of file Universe.h.

◆ OO_SCANCLASS_TYPE

#define OO_SCANCLASS_TYPE

Definition at line 55 of file Universe.h.

◆ OOLITE_EXCEPTION_DATA_NOT_FOUND

#define OOLITE_EXCEPTION_DATA_NOT_FOUND   @"OoliteDataNotFoundException"

Definition at line 158 of file Universe.h.

◆ OOLITE_EXCEPTION_FATAL

#define OOLITE_EXCEPTION_FATAL   @"OoliteFatalException"

Definition at line 159 of file Universe.h.

◆ OOLITE_EXCEPTION_LOOPING

#define OOLITE_EXCEPTION_LOOPING   @"OoliteLoopingException"

Definition at line 157 of file Universe.h.

◆ PASSENGER_BERTH_SPACE

#define PASSENGER_BERTH_SPACE   5

Definition at line 152 of file Universe.h.

◆ PLANETINFO_INTERSTELLAR_KEY

#define PLANETINFO_INTERSTELLAR_KEY   @"interstellar space"

Definition at line 155 of file Universe.h.

◆ PLANETINFO_UNIVERSAL_KEY

#define PLANETINFO_UNIVERSAL_KEY   @"universal"

Definition at line 154 of file Universe.h.

◆ PROXIMITY_AVOID_DISTANCE_FACTOR

#define PROXIMITY_AVOID_DISTANCE_FACTOR   10.0

Definition at line 110 of file Universe.h.

◆ PROXIMITY_WARN_DISTANCE

#define PROXIMITY_WARN_DISTANCE   4

Definition at line 108 of file Universe.h.

◆ PROXIMITY_WARN_DISTANCE2

#define PROXIMITY_WARN_DISTANCE2   (PROXIMITY_WARN_DISTANCE * PROXIMITY_WARN_DISTANCE)

Definition at line 109 of file Universe.h.

◆ SAFE_ADDITION_FACTOR2

#define SAFE_ADDITION_FACTOR2   800

Definition at line 111 of file Universe.h.

◆ SHADERS_MIN

#define SHADERS_MIN   SHADERS_OFF

Definition at line 103 of file Universe.h.

◆ SHIPYARD_KEY_ID

#define SHIPYARD_KEY_ID   @"id"

Definition at line 146 of file Universe.h.

◆ SHIPYARD_KEY_PERSONALITY

#define SHIPYARD_KEY_PERSONALITY   @"personality"

Definition at line 150 of file Universe.h.

Referenced by StationAddShipToShipyard().

◆ SHIPYARD_KEY_PRICE

#define SHIPYARD_KEY_PRICE   @"price"

Definition at line 149 of file Universe.h.

Referenced by StationAddShipToShipyard().

◆ SHIPYARD_KEY_SHIP

#define SHIPYARD_KEY_SHIP   @"ship"

Definition at line 148 of file Universe.h.

◆ SHIPYARD_KEY_SHIPDATA_KEY

#define SHIPYARD_KEY_SHIPDATA_KEY   @"shipdata_key"

Definition at line 147 of file Universe.h.

Referenced by StationAddShipToShipyard().

◆ SUN_SKIM_RADIUS_FACTOR

#define SUN_SKIM_RADIUS_FACTOR   1.15470053838

Definition at line 113 of file Universe.h.

◆ SUN_SPARKS_RADIUS_FACTOR

#define SUN_SPARKS_RADIUS_FACTOR   2.0

Definition at line 114 of file Universe.h.

◆ SYSTEM_REPOPULATION_INTERVAL

#define SYSTEM_REPOPULATION_INTERVAL   20.0f;

Definition at line 176 of file Universe.h.

◆ TIME_ACCELERATION_FACTOR_DEFAULT

#define TIME_ACCELERATION_FACTOR_DEFAULT   1.0f

Definition at line 166 of file Universe.h.

◆ TIME_ACCELERATION_FACTOR_MAX

#define TIME_ACCELERATION_FACTOR_MAX   16.0f

Definition at line 167 of file Universe.h.

◆ TIME_ACCELERATION_FACTOR_MIN

#define TIME_ACCELERATION_FACTOR_MIN   0.0625f

Definition at line 165 of file Universe.h.

◆ UNIVERSE

Typedef Documentation

◆ EntityFilterPredicate

typedef BOOL(* EntityFilterPredicate) (Entity *entity, void *parameter)

Definition at line 52 of file Universe.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
MARKET_NAME 
MARKET_QUANTITY 
MARKET_PRICE 
MARKET_BASE_PRICE 
MARKET_ECO_ADJUST_PRICE 
MARKET_ECO_ADJUST_QUANTITY 
MARKET_BASE_QUANTITY 
MARKET_MASK_PRICE 
MARKET_MASK_QUANTITY 
MARKET_UNITS 

Definition at line 62 of file Universe.h.

63{
64 MARKET_NAME = 0,
66 MARKET_PRICE = 2,
73 MARKET_UNITS = 9
74};
@ MARKET_QUANTITY
Definition Universe.h:65
@ MARKET_ECO_ADJUST_QUANTITY
Definition Universe.h:69
@ MARKET_MASK_PRICE
Definition Universe.h:71
@ MARKET_ECO_ADJUST_PRICE
Definition Universe.h:68
@ MARKET_NAME
Definition Universe.h:64
@ MARKET_UNITS
Definition Universe.h:73
@ MARKET_BASE_PRICE
Definition Universe.h:67
@ MARKET_BASE_QUANTITY
Definition Universe.h:70
@ MARKET_PRICE
Definition Universe.h:66
@ MARKET_MASK_QUANTITY
Definition Universe.h:72

◆ anonymous enum

anonymous enum
Enumerator
EQUIPMENT_TECH_LEVEL_INDEX 
EQUIPMENT_PRICE_INDEX 
EQUIPMENT_SHORT_DESC_INDEX 
EQUIPMENT_KEY_INDEX 
EQUIPMENT_LONG_DESC_INDEX 
EQUIPMENT_EXTRA_INFO_INDEX 

Definition at line 77 of file Universe.h.

78{
85};
@ EQUIPMENT_SHORT_DESC_INDEX
Definition Universe.h:81
@ EQUIPMENT_LONG_DESC_INDEX
Definition Universe.h:83
@ EQUIPMENT_TECH_LEVEL_INDEX
Definition Universe.h:79
@ EQUIPMENT_KEY_INDEX
Definition Universe.h:82
@ EQUIPMENT_PRICE_INDEX
Definition Universe.h:80
@ EQUIPMENT_EXTRA_INFO_INDEX
Definition Universe.h:84

◆ anonymous enum

anonymous enum
Enumerator
OO_POSTFX_NONE 
OO_POSTFX_COLORBLINDNESS_PROTAN 
OO_POSTFX_COLORBLINDNESS_DEUTER 
OO_POSTFX_COLORBLINDNESS_TRITAN 
OO_POSTFX_CLOAK 
OO_POSTFX_GRAYSCALE 
OO_POSTFX_OLDMOVIE 
OO_POSTFX_CRT 
OO_POSTFX_CRTBADSIGNAL 
OO_POSTFX_ENDOFLIST 

Definition at line 88 of file Universe.h.

89{
99 OO_POSTFX_ENDOFLIST // keep this for last
100};
@ OO_POSTFX_COLORBLINDNESS_PROTAN
Definition Universe.h:91
@ OO_POSTFX_ENDOFLIST
Definition Universe.h:99
@ OO_POSTFX_COLORBLINDNESS_TRITAN
Definition Universe.h:93
@ OO_POSTFX_CRT
Definition Universe.h:97
@ OO_POSTFX_COLORBLINDNESS_DEUTER
Definition Universe.h:92
@ OO_POSTFX_GRAYSCALE
Definition Universe.h:95
@ OO_POSTFX_OLDMOVIE
Definition Universe.h:96
@ OO_POSTFX_NONE
Definition Universe.h:90
@ OO_POSTFX_CRTBADSIGNAL
Definition Universe.h:98
@ OO_POSTFX_CLOAK
Definition Universe.h:94

Function Documentation

◆ equipmentSort()

NSComparisonResult equipmentSort ( id a,
id b,
void * context )

Definition at line 11116 of file Universe.m.

11117{
11118 NSArray *one = (NSArray *)a;
11119 NSArray *two = (NSArray *)b;
11120
11121 /* Sort by explicit sort_order, then tech level, then price */
11122
11123 OOCreditsQuantity comp1 = [[one oo_dictionaryAtIndex:EQUIPMENT_EXTRA_INFO_INDEX] oo_unsignedLongLongForKey:@"sort_order" defaultValue:1000];
11124 OOCreditsQuantity comp2 = [[two oo_dictionaryAtIndex:EQUIPMENT_EXTRA_INFO_INDEX] oo_unsignedLongLongForKey:@"sort_order" defaultValue:1000];
11125 if (comp1 < comp2) return NSOrderedAscending;
11126 if (comp1 > comp2) return NSOrderedDescending;
11127
11128 comp1 = [one oo_unsignedLongLongAtIndex:EQUIPMENT_TECH_LEVEL_INDEX];
11129 comp2 = [two oo_unsignedLongLongAtIndex:EQUIPMENT_TECH_LEVEL_INDEX];
11130 if (comp1 < comp2) return NSOrderedAscending;
11131 if (comp1 > comp2) return NSOrderedDescending;
11132
11133 comp1 = [one oo_unsignedLongLongAtIndex:EQUIPMENT_PRICE_INDEX];
11134 comp2 = [two oo_unsignedLongLongAtIndex:EQUIPMENT_PRICE_INDEX];
11135 if (comp1 < comp2) return NSOrderedAscending;
11136 if (comp1 > comp2) return NSOrderedDescending;
11137
11138 return NSOrderedSame;
11139}
uint64_t OOCreditsQuantity
Definition OOTypes.h:182

◆ equipmentSortOutfitting()

NSComparisonResult equipmentSortOutfitting ( id a,
id b,
void * context )

Definition at line 11142 of file Universe.m.

11143{
11144 NSArray *one = (NSArray *)a;
11145 NSArray *two = (NSArray *)b;
11146
11147 /* Sort by explicit sort_order, then tech level, then price */
11148
11149 OOCreditsQuantity comp1 = [[one oo_dictionaryAtIndex:EQUIPMENT_EXTRA_INFO_INDEX] oo_unsignedLongLongForKey:@"purchase_sort_order" defaultValue:[[one oo_dictionaryAtIndex:EQUIPMENT_EXTRA_INFO_INDEX] oo_unsignedLongLongForKey:@"sort_order" defaultValue:1000]];
11150 OOCreditsQuantity comp2 = [[two oo_dictionaryAtIndex:EQUIPMENT_EXTRA_INFO_INDEX] oo_unsignedLongLongForKey:@"purchase_sort_order" defaultValue:[[two oo_dictionaryAtIndex:EQUIPMENT_EXTRA_INFO_INDEX] oo_unsignedLongLongForKey:@"sort_order" defaultValue:1000]];
11151 if (comp1 < comp2) return NSOrderedAscending;
11152 if (comp1 > comp2) return NSOrderedDescending;
11153
11154 comp1 = [one oo_unsignedLongLongAtIndex:EQUIPMENT_TECH_LEVEL_INDEX];
11155 comp2 = [two oo_unsignedLongLongAtIndex:EQUIPMENT_TECH_LEVEL_INDEX];
11156 if (comp1 < comp2) return NSOrderedAscending;
11157 if (comp1 > comp2) return NSOrderedDescending;
11158
11159 comp1 = [one oo_unsignedLongLongAtIndex:EQUIPMENT_PRICE_INDEX];
11160 comp2 = [two oo_unsignedLongLongAtIndex:EQUIPMENT_PRICE_INDEX];
11161 if (comp1 < comp2) return NSOrderedAscending;
11162 if (comp1 > comp2) return NSOrderedDescending;
11163
11164 return NSOrderedSame;
11165}

◆ 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}
return nil
#define UNIVERSE
Definition Universe.h:840

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:

◆ OOGetUniverse()

OOINLINE Universe * OOGetUniverse ( void )

Definition at line 835 of file Universe.h.

836{
838 return gSharedUniverse;
839}
Universe * gSharedUniverse
Definition Universe.m:141

References gSharedUniverse.

◆ OOLookUpDescriptionPRIV()

NSString * OOLookUpDescriptionPRIV ( NSString * key)

Definition at line 11168 of file Universe.m.

11169{
11170 NSString *result = [UNIVERSE descriptionForKey:key];
11171 if (result == nil) result = key;
11172 return result;
11173}

References nil.

Referenced by OOLookUpPluralDescriptionPRIV().

+ Here is the caller graph for this function:

◆ OOLookUpPluralDescriptionPRIV()

NSString * OOLookUpPluralDescriptionPRIV ( NSString * key,
NSInteger count )

Definition at line 11177 of file Universe.m.

11178{
11179 NSArray *conditions = [[UNIVERSE descriptions] oo_arrayForKey:@"plural-rules"];
11180
11181 // are we using an older descriptions.plist (1.72.x) ?
11182 NSString *tmp = [UNIVERSE descriptionForKey:key];
11183 if (tmp != nil)
11184 {
11185 static NSMutableSet *warned = nil;
11186
11187 if (![warned containsObject:tmp])
11188 {
11189 OOLogWARN(@"localization.plurals", @"'%@' found in descriptions.plist, should be '%@%%0'. Localization data needs updating.",key,key);
11190 if (warned == nil) warned = [[NSMutableSet alloc] init];
11191 [warned addObject:tmp];
11192 }
11193 }
11194
11195 if (conditions == nil)
11196 {
11197 if (tmp == nil) // this should mean that descriptions.plist is from 1.73 or above.
11198 return OOLookUpDescriptionPRIV([NSString stringWithFormat:@"%@%%%d", key, count != 1]);
11199 // still using an older descriptions.plist
11200 return tmp;
11201 }
11202 int unsigned i;
11203 long int index;
11204
11205 for (index = i = 0; i < [conditions count]; ++index, ++i)
11206 {
11207 const char *cond = [[conditions oo_stringAtIndex:i] UTF8String];
11208 if (!cond)
11209 break;
11210
11211 long int input = count;
11212 BOOL flag = NO; // we XOR test results with this
11213
11214 while (isspace (*cond))
11215 ++cond;
11216
11217 for (;;)
11218 {
11219 while (isspace (*cond))
11220 ++cond;
11221
11222 char command = *cond++;
11223
11224 switch (command)
11225 {
11226 case 0:
11227 goto passed; // end of string
11228
11229 case '~':
11230 flag = !flag;
11231 continue;
11232 }
11233
11234 long int param = strtol(cond, (char **)&cond, 10);
11235
11236 switch (command)
11237 {
11238 case '#':
11239 index = param;
11240 continue;
11241
11242 case '%':
11243 if (param < 2)
11244 break; // ouch - fail this!
11245 input %= param;
11246 continue;
11247
11248 case '=':
11249 if (flag ^ (input == param))
11250 continue;
11251 break;
11252 case '!':
11253 if (flag ^ (input != param))
11254 continue;
11255 break;
11256
11257 case '<':
11258 if (flag ^ (input < param))
11259 continue;
11260 break;
11261 case '>':
11262 if (flag ^ (input > param))
11263 continue;
11264 break;
11265 }
11266 // if we arrive here, we have an unknown test or a test has failed
11267 break;
11268 }
11269 }
11270
11271passed:
11272 return OOLookUpDescriptionPRIV([NSString stringWithFormat:@"%@%%%ld", key, index]);
11273}
#define OOLogWARN(class, format,...)
Definition OOLogging.h:113
NSString * OOLookUpDescriptionPRIV(NSString *key)
Definition Universe.m:11168

References count, nil, OOLogWARN, and OOLookUpDescriptionPRIV().

+ Here is the call graph for this function:

◆ populatorPrioritySort()

NSComparisonResult populatorPrioritySort ( id a,
id b,
void * context )

Definition at line 11104 of file Universe.m.

11105{
11106 NSDictionary *one = (NSDictionary *)a;
11107 NSDictionary *two = (NSDictionary *)b;
11108 int pri_one = [one oo_intForKey:@"priority" defaultValue:100];
11109 int pri_two = [two oo_intForKey:@"priority" defaultValue:100];
11110 if (pri_one < pri_two) return NSOrderedAscending;
11111 if (pri_one > pri_two) return NSOrderedDescending;
11112 return NSOrderedSame;
11113}