Oolite 1.91.0.7644-241112-7f5034b
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_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 162 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 168 of file Universe.h.

◆ DESC

◆ DESC_PLURAL

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

Definition at line 840 of file Universe.h.

◆ KEY_CHANCE

#define KEY_CHANCE   @"chance"

Definition at line 132 of file Universe.h.

◆ KEY_DESCRIPTION

#define KEY_DESCRIPTION   @"description"

Definition at line 127 of file Universe.h.

◆ KEY_ECONOMY

#define KEY_ECONOMY   @"economy"

Definition at line 116 of file Universe.h.

Referenced by SystemGetProperty().

◆ KEY_ECONOMY_DESC

#define KEY_ECONOMY_DESC   @"economy_description"

Definition at line 117 of file Universe.h.

◆ KEY_EQUIPMENT_AFT_WEAPON

#define KEY_EQUIPMENT_AFT_WEAPON   @"aft_weapon_type"

Definition at line 138 of file Universe.h.

◆ KEY_EQUIPMENT_EXTRAS

#define KEY_EQUIPMENT_EXTRAS   @"extras"

Definition at line 141 of file Universe.h.

◆ KEY_EQUIPMENT_FORWARD_WEAPON

#define KEY_EQUIPMENT_FORWARD_WEAPON   @"forward_weapon_type"

Definition at line 137 of file Universe.h.

◆ KEY_EQUIPMENT_MISSILES

#define KEY_EQUIPMENT_MISSILES   @"missiles"

Definition at line 136 of file Universe.h.

◆ KEY_EQUIPMENT_PORT_WEAPON

#define KEY_EQUIPMENT_PORT_WEAPON   @"port_weapon_type"

Definition at line 139 of file Universe.h.

◆ KEY_EQUIPMENT_STARBOARD_WEAPON

#define KEY_EQUIPMENT_STARBOARD_WEAPON   @"starboard_weapon_type"

Definition at line 140 of file Universe.h.

◆ KEY_GOVERNMENT

#define KEY_GOVERNMENT   @"government"

Definition at line 118 of file Universe.h.

Referenced by SystemGetProperty().

◆ KEY_GOVERNMENT_DESC

#define KEY_GOVERNMENT_DESC   @"government_description"

Definition at line 119 of file Universe.h.

◆ KEY_INHABITANT

#define KEY_INHABITANT   @"inhabitant"

Definition at line 125 of file Universe.h.

◆ KEY_INHABITANTS

#define KEY_INHABITANTS   @"inhabitants"

Definition at line 126 of file Universe.h.

◆ KEY_NAME

#define KEY_NAME   @"name"

Definition at line 124 of file Universe.h.

◆ KEY_OPTIONAL_EQUIPMENT

#define KEY_OPTIONAL_EQUIPMENT   @"optional_equipment"

Definition at line 134 of file Universe.h.

◆ KEY_PLANETNAME

#define KEY_PLANETNAME   @"planet_name"

Definition at line 129 of file Universe.h.

◆ KEY_POPULATION

#define KEY_POPULATION   @"population"

Definition at line 120 of file Universe.h.

Referenced by SystemGetProperty().

◆ KEY_POPULATION_DESC

#define KEY_POPULATION_DESC   @"population_description"

Definition at line 121 of file Universe.h.

◆ KEY_PRICE

#define KEY_PRICE   @"price"

Definition at line 133 of file Universe.h.

◆ KEY_PRODUCTIVITY

#define KEY_PRODUCTIVITY   @"productivity"

Definition at line 122 of file Universe.h.

Referenced by SystemGetProperty().

◆ KEY_RADIUS

#define KEY_RADIUS   @"radius"

Definition at line 123 of file Universe.h.

◆ KEY_RENOVATION_MULTIPLIER

#define KEY_RENOVATION_MULTIPLIER   @"renovation_multiplier"

Definition at line 143 of file Universe.h.

◆ KEY_SHORT_DESCRIPTION

#define KEY_SHORT_DESCRIPTION   @"short_description"

Definition at line 128 of file Universe.h.

Referenced by StationAddShipToShipyard().

◆ KEY_STANDARD_EQUIPMENT

#define KEY_STANDARD_EQUIPMENT   @"standard_equipment"

Definition at line 135 of file Universe.h.

◆ KEY_SUNNAME

#define KEY_SUNNAME   @"sun_name"

Definition at line 130 of file Universe.h.

◆ KEY_TECHLEVEL

#define KEY_TECHLEVEL   @"techlevel"

Definition at line 115 of file Universe.h.

Referenced by SystemGetProperty().

◆ KEY_WEAPON_FACINGS

#define KEY_WEAPON_FACINGS   @"weapon_facings"

Definition at line 142 of file Universe.h.

◆ MASS_DEPENDENT_FUEL_PRICES

#define MASS_DEPENDENT_FUEL_PRICES   1

Definition at line 182 of file Universe.h.

◆ MAX_MESSAGES

#define MAX_MESSAGES   5

Definition at line 105 of file Universe.h.

◆ MIN_DISTANCE_TO_BUOY

#define MIN_DISTANCE_TO_BUOY   750.0f

Definition at line 170 of file Universe.h.

◆ MIN_DISTANCE_TO_BUOY2

#define MIN_DISTANCE_TO_BUOY2   (MIN_DISTANCE_TO_BUOY * MIN_DISTANCE_TO_BUOY)

Definition at line 171 of file Universe.h.

◆ OO_LOCALIZATION_TOOLS

#define OO_LOCALIZATION_TOOLS   1

Definition at line 178 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 157 of file Universe.h.

◆ OOLITE_EXCEPTION_FATAL

#define OOLITE_EXCEPTION_FATAL   @"OoliteFatalException"

Definition at line 158 of file Universe.h.

◆ OOLITE_EXCEPTION_LOOPING

#define OOLITE_EXCEPTION_LOOPING   @"OoliteLoopingException"

Definition at line 156 of file Universe.h.

◆ PASSENGER_BERTH_SPACE

#define PASSENGER_BERTH_SPACE   5

Definition at line 151 of file Universe.h.

◆ PLANETINFO_INTERSTELLAR_KEY

#define PLANETINFO_INTERSTELLAR_KEY   @"interstellar space"

Definition at line 154 of file Universe.h.

◆ PLANETINFO_UNIVERSAL_KEY

#define PLANETINFO_UNIVERSAL_KEY   @"universal"

Definition at line 153 of file Universe.h.

◆ PROXIMITY_AVOID_DISTANCE_FACTOR

#define PROXIMITY_AVOID_DISTANCE_FACTOR   10.0

Definition at line 109 of file Universe.h.

◆ PROXIMITY_WARN_DISTANCE

#define PROXIMITY_WARN_DISTANCE   4

Definition at line 107 of file Universe.h.

◆ PROXIMITY_WARN_DISTANCE2

#define PROXIMITY_WARN_DISTANCE2   (PROXIMITY_WARN_DISTANCE * PROXIMITY_WARN_DISTANCE)

Definition at line 108 of file Universe.h.

◆ SAFE_ADDITION_FACTOR2

#define SAFE_ADDITION_FACTOR2   800

Definition at line 110 of file Universe.h.

◆ SHADERS_MIN

#define SHADERS_MIN   SHADERS_OFF

Definition at line 102 of file Universe.h.

◆ SHIPYARD_KEY_ID

#define SHIPYARD_KEY_ID   @"id"

Definition at line 145 of file Universe.h.

◆ SHIPYARD_KEY_PERSONALITY

#define SHIPYARD_KEY_PERSONALITY   @"personality"

Definition at line 149 of file Universe.h.

Referenced by StationAddShipToShipyard().

◆ SHIPYARD_KEY_PRICE

#define SHIPYARD_KEY_PRICE   @"price"

Definition at line 148 of file Universe.h.

Referenced by StationAddShipToShipyard().

◆ SHIPYARD_KEY_SHIP

#define SHIPYARD_KEY_SHIP   @"ship"

Definition at line 147 of file Universe.h.

◆ SHIPYARD_KEY_SHIPDATA_KEY

#define SHIPYARD_KEY_SHIPDATA_KEY   @"shipdata_key"

Definition at line 146 of file Universe.h.

Referenced by StationAddShipToShipyard().

◆ SUN_SKIM_RADIUS_FACTOR

#define SUN_SKIM_RADIUS_FACTOR   1.15470053838

Definition at line 112 of file Universe.h.

◆ SUN_SPARKS_RADIUS_FACTOR

#define SUN_SPARKS_RADIUS_FACTOR   2.0

Definition at line 113 of file Universe.h.

◆ SYSTEM_REPOPULATION_INTERVAL

#define SYSTEM_REPOPULATION_INTERVAL   20.0f;

Definition at line 175 of file Universe.h.

◆ TIME_ACCELERATION_FACTOR_DEFAULT

#define TIME_ACCELERATION_FACTOR_DEFAULT   1.0f

Definition at line 165 of file Universe.h.

◆ TIME_ACCELERATION_FACTOR_MAX

#define TIME_ACCELERATION_FACTOR_MAX   16.0f

Definition at line 166 of file Universe.h.

◆ TIME_ACCELERATION_FACTOR_MIN

#define TIME_ACCELERATION_FACTOR_MIN   0.0625f

Definition at line 164 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_ENDOFLIST 

Definition at line 88 of file Universe.h.

89{
98 OO_POSTFX_ENDOFLIST // keep this for last
99};
@ OO_POSTFX_COLORBLINDNESS_PROTAN
Definition Universe.h:91
@ OO_POSTFX_ENDOFLIST
Definition Universe.h:98
@ 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_CLOAK
Definition Universe.h:94

Function Documentation

◆ equipmentSort()

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

Definition at line 11093 of file Universe.m.

11094{
11095 NSArray *one = (NSArray *)a;
11096 NSArray *two = (NSArray *)b;
11097
11098 /* Sort by explicit sort_order, then tech level, then price */
11099
11100 OOCreditsQuantity comp1 = [[one oo_dictionaryAtIndex:EQUIPMENT_EXTRA_INFO_INDEX] oo_unsignedLongLongForKey:@"sort_order" defaultValue:1000];
11101 OOCreditsQuantity comp2 = [[two oo_dictionaryAtIndex:EQUIPMENT_EXTRA_INFO_INDEX] oo_unsignedLongLongForKey:@"sort_order" defaultValue:1000];
11102 if (comp1 < comp2) return NSOrderedAscending;
11103 if (comp1 > comp2) return NSOrderedDescending;
11104
11105 comp1 = [one oo_unsignedLongLongAtIndex:EQUIPMENT_TECH_LEVEL_INDEX];
11106 comp2 = [two oo_unsignedLongLongAtIndex:EQUIPMENT_TECH_LEVEL_INDEX];
11107 if (comp1 < comp2) return NSOrderedAscending;
11108 if (comp1 > comp2) return NSOrderedDescending;
11109
11110 comp1 = [one oo_unsignedLongLongAtIndex:EQUIPMENT_PRICE_INDEX];
11111 comp2 = [two oo_unsignedLongLongAtIndex:EQUIPMENT_PRICE_INDEX];
11112 if (comp1 < comp2) return NSOrderedAscending;
11113 if (comp1 > comp2) return NSOrderedDescending;
11114
11115 return NSOrderedSame;
11116}
uint64_t OOCreditsQuantity
Definition OOTypes.h:182

◆ equipmentSortOutfitting()

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

Definition at line 11119 of file Universe.m.

11120{
11121 NSArray *one = (NSArray *)a;
11122 NSArray *two = (NSArray *)b;
11123
11124 /* Sort by explicit sort_order, then tech level, then price */
11125
11126 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]];
11127 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]];
11128 if (comp1 < comp2) return NSOrderedAscending;
11129 if (comp1 > comp2) return NSOrderedDescending;
11130
11131 comp1 = [one oo_unsignedLongLongAtIndex:EQUIPMENT_TECH_LEVEL_INDEX];
11132 comp2 = [two oo_unsignedLongLongAtIndex:EQUIPMENT_TECH_LEVEL_INDEX];
11133 if (comp1 < comp2) return NSOrderedAscending;
11134 if (comp1 > comp2) return NSOrderedDescending;
11135
11136 comp1 = [one oo_unsignedLongLongAtIndex:EQUIPMENT_PRICE_INDEX];
11137 comp2 = [two oo_unsignedLongLongAtIndex:EQUIPMENT_PRICE_INDEX];
11138 if (comp1 < comp2) return NSOrderedAscending;
11139 if (comp1 > comp2) return NSOrderedDescending;
11140
11141 return NSOrderedSame;
11142}

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

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 828 of file Universe.h.

829{
831 return gSharedUniverse;
832}
Universe * gSharedUniverse
Definition Universe.m:141

References gSharedUniverse.

◆ OOLookUpDescriptionPRIV()

NSString * OOLookUpDescriptionPRIV ( NSString * key)

Definition at line 11145 of file Universe.m.

11146{
11147 NSString *result = [UNIVERSE descriptionForKey:key];
11148 if (result == nil) result = key;
11149 return result;
11150}

References nil.

Referenced by OOLookUpPluralDescriptionPRIV().

+ Here is the caller graph for this function:

◆ OOLookUpPluralDescriptionPRIV()

NSString * OOLookUpPluralDescriptionPRIV ( NSString * key,
NSInteger count )

Definition at line 11154 of file Universe.m.

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

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 11081 of file Universe.m.

11082{
11083 NSDictionary *one = (NSDictionary *)a;
11084 NSDictionary *two = (NSDictionary *)b;
11085 int pri_one = [one oo_intForKey:@"priority" defaultValue:100];
11086 int pri_two = [two oo_intForKey:@"priority" defaultValue:100];
11087 if (pri_one < pri_two) return NSOrderedAscending;
11088 if (pri_one > pri_two) return NSOrderedDescending;
11089 return NSOrderedSame;
11090}