Oolite 1.91.0.7646-241128-10e222e
Loading...
Searching...
No Matches
OOCheckDemoShipsPListVerifierStage Class Reference

#include <OOCheckDemoShipsPListVerifierStage.h>

+ Inheritance diagram for OOCheckDemoShipsPListVerifierStage:
+ Collaboration diagram for OOCheckDemoShipsPListVerifierStage:

Instance Methods

(NSString *) - name [implementation]
 
(BOOL) - shouldRun [implementation]
 
(void) - run [implementation]
 
(void) - runCheckWithDemoShips:shipData: [implementation]
 
- Instance Methods inherited from OOFileHandlingVerifierStage
(NSSet *) - dependencies [implementation]
 
(NSSet *) - dependents [implementation]
 
- Instance Methods inherited from OOOXPVerifierStage
(OOOXPVerifier *) - verifier
 
(BOOL) - completed
 
(id) - init [implementation]
 
(void) - dealloc [implementation]
 
(id) - description [implementation]
 
(void) - setVerifier: [implementation]
 
(BOOL) - isDependentOf: [implementation]
 
(void) - registerDependency: [implementation]
 
(void) - dependencyRegistrationComplete [implementation]
 
(BOOL) - canRun [implementation]
 
(void) - performRun [implementation]
 
(void) - noteSkipped [implementation]
 
(NSSet *) - resolvedDependencies [implementation]
 
(NSSet *) - resolvedDependents [implementation]
 
(void) - registerDepedent: [implementation]
 
(void) - dependencyCompleted: [implementation]
 

Detailed Description

Definition at line 33 of file OOCheckDemoShipsPListVerifierStage.h.

Method Documentation

◆ name

- (NSString *) name
implementation

Reimplemented from OOOXPVerifierStage.

Definition at line 32 of file OOCheckDemoShipsPListVerifierStage.m.

45{
46 return kStageName;
47}
static NSString *const kStageName

◆ run

- (void) run
implementation

Reimplemented from OOOXPVerifierStage.

Definition at line 32 of file OOCheckDemoShipsPListVerifierStage.m.

63{
64 OOFileScannerVerifierStage *fileScanner = nil;
65 NSArray *demoshipsPList = nil;
66 NSDictionary *shipdataPList = nil;
67
68 fileScanner = [[self verifier] fileScannerStage];
69
70 demoshipsPList = [fileScanner plistNamed:@"demoships.plist"
71 inFolder:@"Config"
73 checkBuiltIn:NO];
74
75 if (demoshipsPList == nil) return;
76
77 // Check that it's an array
78 if (![demoshipsPList isKindOfClass:[NSArray class]])
79 {
80 OOLog(@"verifyOXP.demoshipsPList.notArray", @"%@", @"***** ERROR: demoships.plist is not an array.");
81 return;
82 }
83
84
85 shipdataPList = [fileScanner plistNamed:@"shipdata.plist"
86 inFolder:@"Config"
88 checkBuiltIn:NO];
89
90 if (shipdataPList == nil) return;
91
92 // Check that it's a dictionary
93 if (![shipdataPList isKindOfClass:[NSDictionary class]])
94 {
95 OOLog(@"verifyOXP.demoshipsPList.notDict", @"%@", @"***** ERROR: shipdata.plist is not a dictionary.");
96 return;
97 }
98
99 [self runCheckWithDemoShips:demoshipsPList shipData:shipdataPList];
100}
#define OOLog(class, format,...)
Definition OOLogging.h:88
return nil
id plistNamed:inFolder:referencedFrom:checkBuiltIn:(NSString *file,[inFolder] NSString *folder,[referencedFrom] NSString *context,[checkBuiltIn] BOOL checkBuiltIn)

◆ runCheckWithDemoShips:shipData:

- (void) runCheckWithDemoShips: (NSArray *) demoshipsPList
shipData: (NSDictionary *) shipdataPList 
implementation

Provided by category OOCheckDemoShipsPListVerifierStage(OOPrivate).

Definition at line 32 of file OOCheckDemoShipsPListVerifierStage.m.

107 :(NSArray *)demoshipsPList shipData:(NSDictionary *)shipdataPList
108{
109 NSEnumerator *nameEnum = nil;
110 NSString *name = nil;
111
112 for (nameEnum = [demoshipsPList objectEnumerator]; (name = [nameEnum nextObject]); )
113 {
114 if ([shipdataPList objectForKey:name] == nil)
115 {
116 OOLog(@"verifyOXP.demoshipsPList.unknownShip", @"----- WARNING: demoships.plist entry \"%@\" not found in shipdata.plist.", name);
117 }
118 }
119}

◆ shouldRun

- (BOOL) shouldRun
implementation

Reimplemented from OOOXPVerifierStage.

Definition at line 32 of file OOCheckDemoShipsPListVerifierStage.m.

51{
52 OOFileScannerVerifierStage *fileScanner = nil;
53
54 fileScanner = [[self verifier] fileScannerStage];
55 return [fileScanner fileExists:@"demoships.plist"
56 inFolder:@"Config"
58 checkBuiltIn:NO];
59}
BOOL fileExists:inFolder:referencedFrom:checkBuiltIn:(NSString *file,[inFolder] NSString *folder,[referencedFrom] NSString *context,[checkBuiltIn] BOOL checkBuiltIn)

The documentation for this class was generated from the following files: