OSDN Git Service

HMShipDeckCommandをSwiftに変換した
authormasakih <masakih@users.sourceforge.jp>
Mon, 9 Jan 2017 10:25:11 +0000 (19:25 +0900)
committermasakih <masakih@users.sourceforge.jp>
Mon, 9 Jan 2017 10:25:11 +0000 (19:25 +0900)
KCD.xcodeproj/project.pbxproj
KCD/HMShipDeckCommand.h [deleted file]
KCD/HMShipDeckCommand.m [deleted file]
KCD/HMShipDeckCommand.swift [new file with mode: 0644]
KCD/KCD-Bridging-Header.h

index abb3a68..920b3a6 100644 (file)
@@ -65,6 +65,7 @@
                F44BC6E71E231534004644E3 /* HMSlotResetCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = F44BC6E61E231534004644E3 /* HMSlotResetCommand.swift */; };
                F44BC6E91E232B15004644E3 /* HMKaisouLockCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = F44BC6E81E232B15004644E3 /* HMKaisouLockCommand.swift */; };
                F44BC6EB1E234531004644E3 /* HMChangeHenseiCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = F44BC6EA1E234531004644E3 /* HMChangeHenseiCommand.swift */; };
+               F44BC6ED1E238577004644E3 /* HMShipDeckCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = F44BC6EC1E238577004644E3 /* HMShipDeckCommand.swift */; };
                F4513EDD18B619B600073552 /* HMCoreDataManager.m in Sources */ = {isa = PBXBuildFile; fileRef = F4513EDC18B619B600073552 /* HMCoreDataManager.m */; };
                F4513EE818B77A5300073552 /* HMMemberKDockCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = F4513EE718B77A5300073552 /* HMMemberKDockCommand.m */; };
                F4513EEB18B7900A00073552 /* HMMemberDeckCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = F4513EEA18B7900A00073552 /* HMMemberDeckCommand.m */; };
                F4BDEB71187252F30069D0CE /* KCDTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F4BDEB70187252F30069D0CE /* KCDTests.m */; };
                F4BDEB7B187253130069D0CE /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F4BDEB7A187253130069D0CE /* WebKit.framework */; };
                F4BEEE9F18D211280006F70C /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = F4BEEE9D18D211280006F70C /* Localizable.strings */; };
-               F4BEEFDB1B0A219E004702B8 /* HMShipDeckCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = F4BEEFDA1B0A219E004702B8 /* HMShipDeckCommand.m */; };
                F4BEEFE11B0B6326004702B8 /* HMDummyShipCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = F4BEEFE01B0B6326004702B8 /* HMDummyShipCommand.m */; };
                F4BEEFE91B0CE312004702B8 /* HMAPIResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = F4BEEFE81B0CE312004702B8 /* HMAPIResponse.m */; };
                F4BEEFFC1B11A5A7004702B8 /* HMExternalBrowserWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F4BEEFFE1B11A5A7004702B8 /* HMExternalBrowserWindowController.xib */; };
                F44BC6E61E231534004644E3 /* HMSlotResetCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMSlotResetCommand.swift; sourceTree = "<group>"; };
                F44BC6E81E232B15004644E3 /* HMKaisouLockCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMKaisouLockCommand.swift; sourceTree = "<group>"; };
                F44BC6EA1E234531004644E3 /* HMChangeHenseiCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMChangeHenseiCommand.swift; sourceTree = "<group>"; };
+               F44BC6EC1E238577004644E3 /* HMShipDeckCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMShipDeckCommand.swift; sourceTree = "<group>"; };
                F4513EDB18B619B600073552 /* HMCoreDataManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HMCoreDataManager.h; sourceTree = "<group>"; };
                F4513EDC18B619B600073552 /* HMCoreDataManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HMCoreDataManager.m; sourceTree = "<group>"; };
                F4513EE618B77A5300073552 /* HMMemberKDockCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HMMemberKDockCommand.h; sourceTree = "<group>"; };
                F4BEEEA118D211360006F70C /* ja */ = {isa = PBXFileReference; lastKnownFileType = text; name = ja; path = ja.lproj/Localizable.strings.sed; sourceTree = "<group>"; };
                F4BEEEA418D211500006F70C /* ja */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; name = ja; path = ja.lproj/Makefile; sourceTree = "<group>"; };
                F4BEEEA718D323520006F70C /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = SOURCE_ROOT; };
-               F4BEEFD91B0A219E004702B8 /* HMShipDeckCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HMShipDeckCommand.h; sourceTree = "<group>"; };
-               F4BEEFDA1B0A219E004702B8 /* HMShipDeckCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HMShipDeckCommand.m; sourceTree = "<group>"; };
                F4BEEFDF1B0B6326004702B8 /* HMDummyShipCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HMDummyShipCommand.h; sourceTree = "<group>"; };
                F4BEEFE01B0B6326004702B8 /* HMDummyShipCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HMDummyShipCommand.m; sourceTree = "<group>"; };
                F4BEEFE71B0CE312004702B8 /* HMAPIResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HMAPIResponse.h; sourceTree = "<group>"; };
                F4649FC51DBBB5100097AEBF /* FormationCommand */ = {
                        isa = PBXGroup;
                        children = (
-                               F4BEEFD91B0A219E004702B8 /* HMShipDeckCommand.h */,
-                               F4BEEFDA1B0A219E004702B8 /* HMShipDeckCommand.m */,
+                               F44BC6EC1E238577004644E3 /* HMShipDeckCommand.swift */,
                                F44BC6EA1E234531004644E3 /* HMChangeHenseiCommand.swift */,
                                F44BC6E81E232B15004644E3 /* HMKaisouLockCommand.swift */,
                                F44BC6E61E231534004644E3 /* HMSlotResetCommand.swift */,
                                F403893E1CAEA711002A264B /* HMMemberRequireInfoCommand.m in Sources */,
                                F431E9761DF3AC1C00FB56AE /* HMSetActionCommand.m in Sources */,
                                F44BC6C71E222675004644E3 /* HMFailedCommand.swift in Sources */,
-                               F4BEEFDB1B0A219E004702B8 /* HMShipDeckCommand.m in Sources */,
                                F47215A01E1E90C10083D3BC /* HMJSONNode.swift in Sources */,
                                F44BC6DB1E2281A7004644E3 /* HMClearItemGetComand.swift in Sources */,
                                F43F3D461A33F7D400D6DAF7 /* HMResetSortieCommand.m in Sources */,
                                F4268034195332A000B2C27F /* HMPowerUpCommand.m in Sources */,
                                F4C5A2231C3533E800533FB6 /* HMEnhancementListItem.m in Sources */,
                                F4048A9D1E18D75E008ACFD6 /* HMDamageView.swift in Sources */,
+                               F44BC6ED1E238577004644E3 /* HMShipDeckCommand.swift in Sources */,
                                F490978D1E1BA64E0085A45D /* HMGuardEscapedView.swift in Sources */,
                                F43769E71AE7D22700DE6204 /* HMKCQuest.m in Sources */,
                                F4D05BCE1E0D50D300688D66 /* HMBrowserContentAdjuster.swift in Sources */,
diff --git a/KCD/HMShipDeckCommand.h b/KCD/HMShipDeckCommand.h
deleted file mode 100644 (file)
index 2d44abf..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-//  HMShipDeckCommand.h
-//  KCD
-//
-//  Created by Hori,Masaki on 2015/05/18.
-//  Copyright (c) 2015年 Hori,Masaki. All rights reserved.
-//
-
-#import "HMCompositCommand.h"
-
-@interface HMShipDeckCommand : HMCompositCommand
-
-@end
diff --git a/KCD/HMShipDeckCommand.m b/KCD/HMShipDeckCommand.m
deleted file mode 100644 (file)
index b44c9d0..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-//  HMShipDeckCommand.m
-//  KCD
-//
-//  Created by Hori,Masaki on 2015/05/18.
-//  Copyright (c) 2015年 Hori,Masaki. All rights reserved.
-//
-
-#import "HMShipDeckCommand.h"
-
-#import "HMMemberShipCommand.h"
-#import "HMMemberDeckCommand.h"
-#import "HMDummyShipCommand.h"
-#import "HMGuardShelterCommand.h"
-#import "HMDropShipHistoryCommand.h"
-
-@implementation HMShipDeckCommand
-//+ (void)load
-//{
-//     static dispatch_once_t onceToken;
-//     dispatch_once(&onceToken, ^{
-//             [HMJSONCommand registerClass:self];
-//     });
-//}
-
-+ (BOOL)canExcuteAPI:(NSString *)api
-{
-       return [api isEqualToString:@"/kcsapi/api_get_member/ship_deck"];
-}
-
-- (instancetype)initWithAPIResponse:(HMAPIResponse *)apiResponse
-{
-    self = [super initWithAPIResponse:apiResponse
-                          commandList:
-            @[
-              [HMMemberShipCommand commandWithAPIResponse:apiResponse],
-              [HMMemberDeckCommand commandWithAPIResponse:apiResponse],
-              [HMDummyShipCommand commandWithAPIResponse:apiResponse],
-              [HMGuardShelterCommand commandWithAPIResponse:apiResponse],
-              [HMDropShipHistoryCommand commandWithAPIResponse:apiResponse],
-              ]];
-    return self;
-}
-@end
diff --git a/KCD/HMShipDeckCommand.swift b/KCD/HMShipDeckCommand.swift
new file mode 100644 (file)
index 0000000..f429439
--- /dev/null
@@ -0,0 +1,27 @@
+//
+//  HMShipDeckCommand.swift
+//  KCD
+//
+//  Created by Hori,Masaki on 2017/01/09.
+//  Copyright © 2017年 Hori,Masaki. All rights reserved.
+//
+
+import Cocoa
+
+class HMShipDeckCommand: HMCompositCommand {
+    override init(apiResponse: HMAPIResponse) {
+        super.init(apiResponse: apiResponse, commandList:
+            [
+                HMMemberShipCommand(apiResponse: apiResponse),
+                HMMemberDeckCommand(apiResponse: apiResponse),
+                HMDummyShipCommand(apiResponse: apiResponse),
+                HMGuardShelterCommand(apiResponse: apiResponse),
+                HMDropShipHistoryCommand(apiResponse: apiResponse),
+            ]
+        )
+    }
+    override class func canExcuteAPI(_ api: String) -> Bool {
+        if api == "/kcsapi/api_get_member/ship_deck" { return true }
+        return false
+    }
+}
index f1ea1c4..ff131e1 100644 (file)
@@ -55,7 +55,6 @@
 #import "HMDestroyShipCommand.h"
 #import "HMPowerUpCommand.h"
 #import "HMRemodelSlotCommand.h"
-#import "HMShipDeckCommand.h"
 #import "HMResetSortieCommand.h"
 #import "HMDropShipHistoryCommand.h"
 #import "HMDummyShipCommand.h"