OSDN Git Service

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

index cb402f0..1e7af0f 100644 (file)
@@ -58,6 +58,7 @@
                F44BC6C71E222675004644E3 /* HMFailedCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = F44BC6C61E222675004644E3 /* HMFailedCommand.swift */; };
                F44BC6C91E22314B004644E3 /* HMUnknownComand.swift in Sources */ = {isa = PBXBuildFile; fileRef = F44BC6C81E22314B004644E3 /* HMUnknownComand.swift */; };
                F44BC6CB1E223208004644E3 /* HMIgnoreCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = F44BC6CA1E223208004644E3 /* HMIgnoreCommand.swift */; };
+               F44BC6D11E224299004644E3 /* HMPortCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = F44BC6D01E224299004644E3 /* HMPortCommand.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 */; };
@@ -96,7 +97,6 @@
                F48A705D1DE58A38005DFC0B /* HMKCAirBase+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = F48A70571DE58A38005DFC0B /* HMKCAirBase+CoreDataProperties.m */; };
                F48A705E1DE58A38005DFC0B /* HMKCAirBasePlaneInfo+CoreDataClass.m in Sources */ = {isa = PBXBuildFile; fileRef = F48A70591DE58A38005DFC0B /* HMKCAirBasePlaneInfo+CoreDataClass.m */; };
                F48A705F1DE58A38005DFC0B /* HMKCAirBasePlaneInfo+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = F48A705B1DE58A38005DFC0B /* HMKCAirBasePlaneInfo+CoreDataProperties.m */; };
-               F48F7B021907D7B800E78AE1 /* HMPortCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = F48F7B011907D7B800E78AE1 /* HMPortCommand.m */; };
                F490977B1E19C3910085A45D /* HMSuppliesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F490977A1E19C3910085A45D /* HMSuppliesView.swift */; };
                F490977D1E19DF390085A45D /* HMSlotItemFrameView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F490977C1E19DF390085A45D /* HMSlotItemFrameView.swift */; };
                F490977F1E19ED400085A45D /* HMStrengthenListItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F490977E1E19ED400085A45D /* HMStrengthenListItemView.swift */; };
                F44BC6C61E222675004644E3 /* HMFailedCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMFailedCommand.swift; sourceTree = "<group>"; };
                F44BC6C81E22314B004644E3 /* HMUnknownComand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMUnknownComand.swift; sourceTree = "<group>"; };
                F44BC6CA1E223208004644E3 /* HMIgnoreCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMIgnoreCommand.swift; sourceTree = "<group>"; };
+               F44BC6D01E224299004644E3 /* HMPortCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMPortCommand.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>"; };
                F48A70591DE58A38005DFC0B /* HMKCAirBasePlaneInfo+CoreDataClass.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "HMKCAirBasePlaneInfo+CoreDataClass.m"; sourceTree = "<group>"; };
                F48A705A1DE58A38005DFC0B /* HMKCAirBasePlaneInfo+CoreDataProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "HMKCAirBasePlaneInfo+CoreDataProperties.h"; sourceTree = "<group>"; };
                F48A705B1DE58A38005DFC0B /* HMKCAirBasePlaneInfo+CoreDataProperties.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "HMKCAirBasePlaneInfo+CoreDataProperties.m"; sourceTree = "<group>"; };
-               F48F7B001907D7B800E78AE1 /* HMPortCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HMPortCommand.h; sourceTree = "<group>"; };
-               F48F7B011907D7B800E78AE1 /* HMPortCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HMPortCommand.m; sourceTree = "<group>"; };
                F490977A1E19C3910085A45D /* HMSuppliesView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMSuppliesView.swift; sourceTree = "<group>"; };
                F490977C1E19DF390085A45D /* HMSlotItemFrameView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMSlotItemFrameView.swift; sourceTree = "<group>"; };
                F490977E1E19ED400085A45D /* HMStrengthenListItemView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMStrengthenListItemView.swift; sourceTree = "<group>"; };
                                F4649FC51DBBB5100097AEBF /* FormationCommand */,
                                F4649FC61DBBB5870097AEBF /* QuestCommand */,
                                F4649FBF1DBBB0F50097AEBF /* Supply&DockCommand */,
-                               F4C1190918A74DF0005D5B25 /* HMJSONCommand.h */,
                                F4B15CBC1E21BA870078CFFC /* CommandRegister.swift */,
+                               F4C1190918A74DF0005D5B25 /* HMJSONCommand.h */,
                                F4C1190A18A74DF0005D5B25 /* HMJSONCommand.m */,
                                F4D2CBC318AE2AE2000EBC59 /* HMCompositCommand.h */,
                                F4D2CBC418AE2AE2000EBC59 /* HMCompositCommand.m */,
+                               F44BC6D01E224299004644E3 /* HMPortCommand.swift */,
                                F44BC6CA1E223208004644E3 /* HMIgnoreCommand.swift */,
                                F44BC6C81E22314B004644E3 /* HMUnknownComand.swift */,
                                F44BC6C61E222675004644E3 /* HMFailedCommand.swift */,
-                               F48F7B001907D7B800E78AE1 /* HMPortCommand.h */,
-                               F48F7B011907D7B800E78AE1 /* HMPortCommand.m */,
                                F44BC6C41E222279004644E3 /* HMPortNotifyCommand.swift */,
                                F44BC6C21E221865004644E3 /* HMAirCorpsSupplyCommand.swift */,
                                F44BC6C01E221293004644E3 /* HMAirCorpsChangeNameCommand.swift */,
                                F4F9F87E1C6B5E4A00D0EE76 /* HMKCMasterSType.m in Sources */,
                                F4AA59251E1CE7E5001667AF /* HMKCMasterSlotItemEquipTypeObject+CoreDataClass.m in Sources */,
                                F4048A9F1E19308A008ACFD6 /* HMStrokeTextFieldCell.swift in Sources */,
+                               F44BC6D11E224299004644E3 /* HMPortCommand.swift in Sources */,
                                F45F3BE11E067A870009434E /* HMHistoryItemCleaner.swift in Sources */,
                                F4E5FF0C1E1645280026868C /* HMScreenshotListViewController.swift in Sources */,
                                F426802B194D0F4800B2C27F /* HMMemberShip2Command.m in Sources */,
                                F47215B01E1FEACC0083D3BC /* HMServerDataStore.swift in Sources */,
                                F47215A81E1F947A0083D3BC /* HMBookmarkDataStore.swift in Sources */,
                                F4B1E30F19D1C9C400805879 /* HMApplySuppliesCommand.m in Sources */,
-                               F48F7B021907D7B800E78AE1 /* HMPortCommand.m in Sources */,
                                F4AA59421E1E2854001667AF /* HMOrderedSetToArrayTransformer.swift in Sources */,
                                F494DC5F18C30AE100AE97E4 /* HMMissionStatus.m in Sources */,
                                F43F3D4C1A34AC8000D6DAF7 /* HMKCMasterShipObject.m in Sources */,
diff --git a/KCD/HMPortCommand.h b/KCD/HMPortCommand.h
deleted file mode 100644 (file)
index 7ddebb0..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-//  HMPortCommand.h
-//  KCD
-//
-//  Created by Hori,Masaki on 2014/04/23.
-//  Copyright (c) 2014年 Hori,Masaki. All rights reserved.
-//
-
-#import "HMCompositCommand.h"
-
-@interface HMPortCommand : HMCompositCommand
-
-@end
diff --git a/KCD/HMPortCommand.m b/KCD/HMPortCommand.m
deleted file mode 100644 (file)
index 93a7af3..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-//  HMPortCommand.m
-//  KCD
-//
-//  Created by Hori,Masaki on 2014/04/23.
-//  Copyright (c) 2014年 Hori,Masaki. All rights reserved.
-//
-
-#import "HMPortCommand.h"
-
-#import "KCD-Swift.h"
-
-#import "HMMemberShipCommand.h"
-#import "HMMemberMaterialCommand.h"
-#import "HMMemberDeckCommand.h"
-#import "HMMemberBasicCommand.h"
-#import "HMMemberNDockCommand.h"
-#import "HMResetSortieCommand.h"
-#import "HMDropShipHistoryCommand.h"
-#import "HMDummyShipCommand.h"
-#import "HMGuardShelterCommand.h"
-#import "HMCombinedCommand.h"
-
-
-@implementation HMPortCommand
-//+ (void)load
-//{
-//     static dispatch_once_t onceToken;
-//     dispatch_once(&onceToken, ^{
-//             [HMJSONCommand registerClass:self];
-//     });
-//}
-
-+ (BOOL)canExcuteAPI:(NSString *)api
-{
-       return [api isEqualToString:@"/kcsapi/api_port/port"];
-}
-
-- (instancetype)initWithAPIResponse:(HMAPIResponse *)apiResponse
-{
-    self = [super initWithAPIResponse:apiResponse
-                          commandList:
-            @[
-              [HMMemberShipCommand commandForAPIResult:apiResponse],
-              [HMMemberMaterialCommand commandForAPIResult:apiResponse],
-              [HMMemberDeckCommand commandForAPIResult:apiResponse],
-              [HMMemberBasicCommand commandForAPIResult:apiResponse],
-              [HMMemberNDockCommand commandForAPIResult:apiResponse],
-              [HMResetSortieCommand commandForAPIResult:apiResponse],
-              [HMDropShipHistoryCommand commandForAPIResult:apiResponse],
-              [HMDummyShipCommand commandForAPIResult:apiResponse],
-              [HMPortNotifyCommand commandForAPIResult:apiResponse],
-              [HMGuardShelterCommand commandForAPIResult:apiResponse],
-              [HMCombinedCommand commandForAPIResult:apiResponse],
-              ]];
-    return self;
-}
-@end
diff --git a/KCD/HMPortCommand.swift b/KCD/HMPortCommand.swift
new file mode 100644 (file)
index 0000000..17e36f8
--- /dev/null
@@ -0,0 +1,33 @@
+//
+//  HMPortCommand.swift
+//  KCD
+//
+//  Created by Hori,Masaki on 2017/01/08.
+//  Copyright © 2017年 Hori,Masaki. All rights reserved.
+//
+
+import Cocoa
+
+class HMPortCommand: HMCompositCommand {
+    override init(apiResponse: HMAPIResponse) {
+        super.init(apiResponse: apiResponse, commandList:
+            [
+                HMMemberShipCommand(apiResponse: apiResponse),
+                HMMemberMaterialCommand(apiResponse: apiResponse),
+                HMMemberDeckCommand(apiResponse: apiResponse),
+                HMMemberBasicCommand(apiResponse: apiResponse),
+                HMMemberNDockCommand(apiResponse: apiResponse),
+                HMResetSortieCommand(apiResponse: apiResponse),
+                HMDropShipHistoryCommand(apiResponse: apiResponse),
+                HMDummyShipCommand(apiResponse: apiResponse),
+                HMPortNotifyCommand(apiResponse: apiResponse),
+                HMGuardShelterCommand(apiResponse: apiResponse),
+                HMCombinedCommand(apiResponse: apiResponse)
+            ]
+        )
+    }
+    override class func canExcuteAPI(_ api: String) -> Bool {
+        if api == "/kcsapi/api_port/port" { return true }
+        return false
+    }
+}
index e1718aa..7ce2e41 100644 (file)
@@ -66,8 +66,9 @@
 #import "HMNyukyoStartCommand.h"
 #import "HMHokyuChargeCommand.h"
 #import "HMNyukyoSpeedChangeCommand.h"
-#import "HMPortCommand.h"
-
+#import "HMResetSortieCommand.h"
+#import "HMDropShipHistoryCommand.h"
+#import "HMDummyShipCommand.h"
 
 // Core Data
 #import "HMBookmarkManager.h"