From c4b4f8726f05ef089d77f5506d013d818e4224bf Mon Sep 17 00:00:00 2001 From: masakih Date: Sun, 8 Jan 2017 20:19:45 +0900 Subject: [PATCH] =?utf8?q?HMPortCommand=E3=82=92Swift=E3=81=AB=E5=A4=89?= =?utf8?q?=E6=8F=9B=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- KCD.xcodeproj/project.pbxproj | 12 ++++----- KCD/HMPortCommand.h | 13 ---------- KCD/HMPortCommand.m | 58 ------------------------------------------- KCD/HMPortCommand.swift | 33 ++++++++++++++++++++++++ KCD/KCD-Bridging-Header.h | 5 ++-- 5 files changed, 41 insertions(+), 80 deletions(-) delete mode 100644 KCD/HMPortCommand.h delete mode 100644 KCD/HMPortCommand.m create mode 100644 KCD/HMPortCommand.swift diff --git a/KCD.xcodeproj/project.pbxproj b/KCD.xcodeproj/project.pbxproj index cb402f0e..1e7af0f4 100644 --- a/KCD.xcodeproj/project.pbxproj +++ b/KCD.xcodeproj/project.pbxproj @@ -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 */; }; @@ -409,6 +409,7 @@ F44BC6C61E222675004644E3 /* HMFailedCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMFailedCommand.swift; sourceTree = ""; }; F44BC6C81E22314B004644E3 /* HMUnknownComand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMUnknownComand.swift; sourceTree = ""; }; F44BC6CA1E223208004644E3 /* HMIgnoreCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMIgnoreCommand.swift; sourceTree = ""; }; + F44BC6D01E224299004644E3 /* HMPortCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMPortCommand.swift; sourceTree = ""; }; F4513EDB18B619B600073552 /* HMCoreDataManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HMCoreDataManager.h; sourceTree = ""; }; F4513EDC18B619B600073552 /* HMCoreDataManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HMCoreDataManager.m; sourceTree = ""; }; F4513EE618B77A5300073552 /* HMMemberKDockCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HMMemberKDockCommand.h; sourceTree = ""; }; @@ -470,8 +471,6 @@ F48A70591DE58A38005DFC0B /* HMKCAirBasePlaneInfo+CoreDataClass.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "HMKCAirBasePlaneInfo+CoreDataClass.m"; sourceTree = ""; }; F48A705A1DE58A38005DFC0B /* HMKCAirBasePlaneInfo+CoreDataProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "HMKCAirBasePlaneInfo+CoreDataProperties.h"; sourceTree = ""; }; F48A705B1DE58A38005DFC0B /* HMKCAirBasePlaneInfo+CoreDataProperties.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "HMKCAirBasePlaneInfo+CoreDataProperties.m"; sourceTree = ""; }; - F48F7B001907D7B800E78AE1 /* HMPortCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HMPortCommand.h; sourceTree = ""; }; - F48F7B011907D7B800E78AE1 /* HMPortCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HMPortCommand.m; sourceTree = ""; }; F490977A1E19C3910085A45D /* HMSuppliesView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMSuppliesView.swift; sourceTree = ""; }; F490977C1E19DF390085A45D /* HMSlotItemFrameView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMSlotItemFrameView.swift; sourceTree = ""; }; F490977E1E19ED400085A45D /* HMStrengthenListItemView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMStrengthenListItemView.swift; sourceTree = ""; }; @@ -1345,16 +1344,15 @@ 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 */, @@ -1695,6 +1693,7 @@ 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 */, @@ -1793,7 +1792,6 @@ 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 index 7ddebb09..00000000 --- a/KCD/HMPortCommand.h +++ /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 index 93a7af34..00000000 --- a/KCD/HMPortCommand.m +++ /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 index 00000000..17e36f88 --- /dev/null +++ b/KCD/HMPortCommand.swift @@ -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 + } +} diff --git a/KCD/KCD-Bridging-Header.h b/KCD/KCD-Bridging-Header.h index e1718aac..7ce2e41e 100644 --- a/KCD/KCD-Bridging-Header.h +++ b/KCD/KCD-Bridging-Header.h @@ -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" -- 2.11.0