OSDN Git Service

艦種カテゴリーを1ヶ所にまとめた
authormasakih <masakih@users.sourceforge.jp>
Mon, 17 Mar 2014 14:21:11 +0000 (23:21 +0900)
committermasakih <masakih@users.sourceforge.jp>
Mon, 17 Mar 2014 14:21:11 +0000 (23:21 +0900)
KCD/HMAppDelegate.h
KCD/HMAppDelegate.m
KCD/HMPowerUpSupportViewController.m
KCD/HMShipViewController.m
KCD/HMShipWindowController.m

index f504114..2957127 100644 (file)
@@ -20,4 +20,7 @@
 
 @property (strong) HMJSONViewWindowController *jsonViewWindowController;
 
+
+@property (readonly) NSArray *shipTypeCategories;
+
 @end
index c0568f2..fc70124 100644 (file)
@@ -85,6 +85,24 @@ static FILE* logFileP = NULL;
 #endif
 }
 
+- (NSArray *)shipTypeCategories
+{
+       static NSArray *categories = nil;
+       
+       if(categories) return categories;
+       
+       categories = @[
+                                  @[@2],
+                                  @[@3, @4],
+                                  @[@5,@6],
+                                  @[@7, @11, @16, @18],
+                                  @[@8, @9, @10, @12],
+                                  @[@13, @14],
+                                  @[@1, @15, @17]
+                                  ];
+       return categories;
+}
+
 #pragma mark - NSApplicationDelegate
 - (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender
 {
@@ -103,7 +121,7 @@ static FILE* logFileP = NULL;
        NSSavePanel *panel = [NSSavePanel savePanel];
        [panel setAllowedFileTypes:@[@"plist"]];
        [panel setPrompt:@"Save log"];
-       [panel setTitle:@"Sace log"];
+       [panel setTitle:@"Save log"];
        [panel beginWithCompletionHandler:^(NSInteger result) {
                if(result == NSOKButton) {
                        NSArray *array = [self.jsonViewWindowController.commands copy];
index 77158b6..f06dac4 100644 (file)
@@ -8,6 +8,7 @@
 
 #import "HMPowerUpSupportViewController.h"
 
+#import "HMAppDelegate.h"
 #import "HMCoreDataManager.h"
 
 
 
 - (IBAction)changeCategory:(id)sender
 {
-       NSArray *categories = @[
-                                                       @[@2],
-                                                       @[@3, @4],
-                                                       @[@5,@6],
-                                                       @[@7, @11, @16, @18],
-                                                       @[@8, @9, @10, @12],
-                                                       @[@13, @14],
-                                                       @[@1, @15, @17]
-                                                       ];
+       NSArray *categories = [[NSApp delegate] shipTypeCategories];
        
        NSPredicate *predicate = [self omitPredicate];
        NSUInteger tag = [self.typeSegment selectedSegment];
index 53400a9..ab0ed70 100644 (file)
@@ -8,6 +8,7 @@
 
 #import "HMShipViewController.h"
 
+#import "HMAppDelegate.h"
 #import "HMCoreDataManager.h"
 
 
@@ -65,15 +66,7 @@ typedef NS_ENUM(NSInteger, ViewType) {
 
 - (IBAction)changeCategory:(id)sender
 {
-       NSArray *categories = @[
-                                                       @[@2],
-                                                       @[@3, @4],
-                                                       @[@5,@6],
-                                                       @[@7, @11, @16, @18],
-                                                       @[@8, @9, @10, @12],
-                                                       @[@13, @14],
-                                                       @[@1, @15, @17]
-                                                       ];
+       NSArray *categories = [[NSApp delegate] shipTypeCategories];
        
        NSPredicate *predicate = nil;
        NSUInteger tag = [sender selectedSegment];
index 154b7e1..62fa09f 100644 (file)
@@ -8,6 +8,7 @@
 
 #import "HMShipWindowController.h"
 
+#import "HMAppDelegate.h"
 #import "HMCoreDataManager.h"
 
 
 
 - (IBAction)changeCategory:(id)sender
 {
-       NSArray *categories = @[
-                                                       @[@2],
-                                                       @[@3, @4],
-                                                       @[@5,@6],
-                                                       @[@7, @11, @16, @18],
-                                                       @[@8, @9, @10, @12],
-                                                       @[@13, @14],
-                                                       @[@1, @15, @17]
-                                                       ];
+       NSArray *categories = [[NSApp delegate] shipTypeCategories];
        
        NSPredicate *predicate = nil;
        NSUInteger tag = [sender selectedSegment];