◆ calculatePropertiesForSystemKey:
- (NSDictionary *) calculatePropertiesForSystemKey: |
|
(NSString *) | key |
|
Extends class OOSystemDescriptionManager.
Definition at line 58 of file OOSystemDescriptionManager.m.
503 :(NSString *)key
504{
505 NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithCapacity:OO_LIKELY_PROPERTIES_PER_SYSTEM];
506 NSString *
property =
nil;
508 BOOL interstellar = [key hasPrefix:@"interstellar:"];
509 foreach (property, propertiesInUse)
510 {
511
512 val = [self getProperty:property forSystemKey:key withUniversal:!interstellar];
513
515 {
516 [dict setObject:val forKey:property];
517 }
518 else if (interstellar)
519 {
520
521
522 val = [self getProperty:property forSystemKey:@"interstellar"];
524 {
525 [dict setObject:val forKey:property];
526 }
527 }
528 }
529 return dict;
530}
◆ getProperty:forSystemKey:withUniversal:
- (id) getProperty: |
|
(NSString *) | property |
forSystemKey: |
|
(NSString *) | key |
withUniversal: |
|
(BOOL) | universal |
Extends class OOSystemDescriptionManager.
Definition at line 58 of file OOSystemDescriptionManager.m.
394 :(NSString *)property forSystemKey:(NSString *)key withUniversal:(BOOL)universal
395{
397 if (
EXPECT_NOT([key isEqualToString:
@"interstellar"]))
398 {
399 desc = interstellarSpace;
400 }
401 else
402 {
403 desc = [systemDescriptions objectForKey:key];
404 }
406 {
408 }
412 {
414 }
416 {
418 }
419 if (result ==
nil && universal)
420 {
421 result = [universalProperties objectForKey:property];
422 }
424 {
426 }
427 return result;
428}
id getProperty:forLayer:(NSString *property,[forLayer] OOSystemLayer layer)
◆ getProperty:orProperty:forSystemKey:withUniversal:
- (id) getProperty: |
|
(NSString *) | property1 |
orProperty: |
|
(NSString *) | property2 |
forSystemKey: |
|
(NSString *) | key |
withUniversal: |
|
(BOOL) | universal |
Extends class OOSystemDescriptionManager.
Definition at line 58 of file OOSystemDescriptionManager.m.
431 :(NSString *)property1 orProperty:(NSString *)property2 forSystemKey:(NSString *)key withUniversal:(BOOL)universal
432{
435 {
437 }
441 {
443 }
445 {
447 }
449 {
451 }
453 {
455 }
457 {
459 }
460 if (universal)
461 {
463 {
464 result = [universalProperties objectForKey:property1];
465 }
467 {
468 result = [universalProperties objectForKey:property2];
469 }
470 }
472 {
474 }
476 {
478 }
479 return result;
480}
◆ saveScriptedChangeToProperty:forSystemKey:andLayer:toValue:fromManifest:
- (void) saveScriptedChangeToProperty: |
|
(NSString *) | property |
forSystemKey: |
|
(NSString *) | key |
andLayer: |
|
(OOSystemLayer) | layer |
toValue: |
|
(id) | value |
fromManifest: |
|
(NSString *) | manifest |
Extends class OOSystemDescriptionManager.
Definition at line 58 of file OOSystemDescriptionManager.m.
215 :(NSString *)property forSystemKey:(NSString *)key andLayer:(
OOSystemLayer)layer toValue:(id)value fromManifest:(NSString *)manifest
216{
217
219 {
220 return;
221 }
222
223 NSArray *overrideKey = [NSArray arrayWithObjects:manifest,key,property,[[NSNumber numberWithInt:layer] stringValue],nil];
224
225
226 NSString *overrideKeyStr = [overrideKey componentsJoinedByString:kOOScriptedChangeJoiner];
228 {
229 [scriptedChanges setObject:value forKey:overrideKeyStr];
230 }
231 else
232 {
233 [scriptedChanges removeObjectForKey:overrideKeyStr];
234 }
235}
◆ setProperties:inDescription:
Extends class OOSystemDescriptionManager.
Definition at line 58 of file OOSystemDescriptionManager.m.
484{
485 OOSystemLayer layer = [properties oo_unsignedIntForKey:kOOSystemLayerProperty defaultValue:OO_LAYER_OXP_STATIC];
487 {
488 OOLog(
@"system.description.error",
@"Layer %u is not a valid layer number in system information.",layer);
490 }
493 {
495 {
496 [propertiesInUse addObject:key];
498 }
499 }
500}
#define foreachkey(VAR, DICT)
#define OOLog(class, format,...)
static NSString * kOOSystemLayerProperty
void setProperty:forLayer:toValue:(NSString *property,[forLayer] OOSystemLayer layer,[toValue] id value)
◆ updateCacheEntry:
- (void) updateCacheEntry: |
|
(NSUInteger) | i |
|
Extends class OOSystemDescriptionManager.
Definition at line 58 of file OOSystemDescriptionManager.m.
533 :(NSUInteger)i
534{
536 NSString *key = [NSString stringWithFormat:@"%lu %lu",i/OO_SYSTEMS_PER_GALAXY,i%OO_SYSTEMS_PER_GALAXY];
537 NSDictionary *current = [self calculatePropertiesForSystemKey:key];
538
539 [propertyCache[i] removeAllObjects];
540 [propertyCache[i] addEntriesFromDictionary:current];
541}
#define OO_SYSTEM_CACHE_LENGTH
◆ updateCacheEntry:forProperty:
Extends class OOSystemDescriptionManager.
Definition at line 58 of file OOSystemDescriptionManager.m.
544 :(NSUInteger)i forProperty:(NSString *)property
545{
547 NSString *key = [NSString stringWithFormat:@"%lu %lu",i/OO_SYSTEMS_PER_GALAXY,i%OO_SYSTEMS_PER_GALAXY];
548 id current = [self getProperty:property forSystemKey:key];
550 {
551 [propertyCache[i] removeObjectForKey:property];
552 }
553 else
554 {
555 [propertyCache[i] setObject:current forKey:property];
556 }
557}
The documentation for this category was generated from the following file: