From 2def69abd7b3dc3a99aae626f19904ca27ae7d6c Mon Sep 17 00:00:00 2001 From: masakih Date: Mon, 9 Jan 2017 08:50:27 +0900 Subject: [PATCH] =?utf8?q?HMSlotDepriveCommand=E3=82=92Swift=E3=81=AB?= =?utf8?q?=E5=A4=89=E6=8F=9B=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit HMSlotDepriveUnsetCommandをSwiftに変換した --- KCD.xcodeproj/project.pbxproj | 20 ++++++++----------- KCD/HMSlotDepriveCommand.h | 13 ------------- KCD/HMSlotDepriveCommand.m | 38 ------------------------------------- KCD/HMSlotDepriveCommand.swift | 24 +++++++++++++++++++++++ KCD/HMSlotDepriveUnsetCommand.h | 12 ------------ KCD/HMSlotDepriveUnsetCommand.m | 16 ---------------- KCD/HMSlotDepriveUnsetCommand.swift | 13 +++++++++++++ KCD/KCD-Bridging-Header.h | 1 - 8 files changed, 45 insertions(+), 92 deletions(-) delete mode 100644 KCD/HMSlotDepriveCommand.h delete mode 100644 KCD/HMSlotDepriveCommand.m create mode 100644 KCD/HMSlotDepriveCommand.swift delete mode 100644 KCD/HMSlotDepriveUnsetCommand.h delete mode 100644 KCD/HMSlotDepriveUnsetCommand.m create mode 100644 KCD/HMSlotDepriveUnsetCommand.swift diff --git a/KCD.xcodeproj/project.pbxproj b/KCD.xcodeproj/project.pbxproj index 259870ac..516f985a 100644 --- a/KCD.xcodeproj/project.pbxproj +++ b/KCD.xcodeproj/project.pbxproj @@ -62,6 +62,8 @@ F44BC6DB1E2281A7004644E3 /* HMClearItemGetComand.swift in Sources */ = {isa = PBXBuildFile; fileRef = F44BC6DA1E2281A7004644E3 /* HMClearItemGetComand.swift */; }; F44BC6DD1E228345004644E3 /* HMUpdateQuestListCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = F44BC6DC1E228345004644E3 /* HMUpdateQuestListCommand.swift */; }; F44BC6DF1E228770004644E3 /* HMQuestListCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = F44BC6DE1E228770004644E3 /* HMQuestListCommand.swift */; }; + F44BC6E11E2304E3004644E3 /* HMSlotDepriveUnsetCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = F44BC6E01E2304E3004644E3 /* HMSlotDepriveUnsetCommand.swift */; }; + F44BC6E31E230577004644E3 /* HMSlotDepriveCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = F44BC6E21E230577004644E3 /* HMSlotDepriveCommand.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 */; }; @@ -82,8 +84,6 @@ F4666C6B1B29E974001840DB /* EquipmentStrengthen.plist in Resources */ = {isa = PBXBuildFile; fileRef = F4666C6A1B29E974001840DB /* EquipmentStrengthen.plist */; }; F46F103618A7CE310063E503 /* HMJSONViewCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = F46F103518A7CE310063E503 /* HMJSONViewCommand.m */; }; F46F104918ABAC910063E503 /* KCD.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = F46F104718ABAC910063E503 /* KCD.xcdatamodeld */; }; - F46F45BF1CFF0BEE00EB7F4D /* HMSlotDepriveCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = F46F45BE1CFF0BEE00EB7F4D /* HMSlotDepriveCommand.m */; }; - F46F45C21CFF0CFF00EB7F4D /* HMSlotDepriveUnsetCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = F46F45C11CFF0CFF00EB7F4D /* HMSlotDepriveUnsetCommand.m */; }; F471784A1B6F9B5600F5E59D /* ResourceHistory.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = F47178481B6F9B5600F5E59D /* ResourceHistory.xcdatamodeld */; }; F471784D1B6FA18800F5E59D /* HMKCResource.m in Sources */ = {isa = PBXBuildFile; fileRef = F471784C1B6FA18800F5E59D /* HMKCResource.m */; }; F472159E1E1E6EE70083D3BC /* HMShipMasterDetailWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F472159D1E1E6EE70083D3BC /* HMShipMasterDetailWindowController.swift */; }; @@ -409,6 +409,8 @@ F44BC6DA1E2281A7004644E3 /* HMClearItemGetComand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMClearItemGetComand.swift; sourceTree = ""; }; F44BC6DC1E228345004644E3 /* HMUpdateQuestListCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMUpdateQuestListCommand.swift; sourceTree = ""; }; F44BC6DE1E228770004644E3 /* HMQuestListCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMQuestListCommand.swift; sourceTree = ""; }; + F44BC6E01E2304E3004644E3 /* HMSlotDepriveUnsetCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMSlotDepriveUnsetCommand.swift; sourceTree = ""; }; + F44BC6E21E230577004644E3 /* HMSlotDepriveCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMSlotDepriveCommand.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 = ""; }; @@ -443,10 +445,6 @@ F46F103418A7CE310063E503 /* HMJSONViewCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HMJSONViewCommand.h; sourceTree = ""; }; F46F103518A7CE310063E503 /* HMJSONViewCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HMJSONViewCommand.m; sourceTree = ""; }; F46F104818ABAC910063E503 /* KCD.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = KCD.xcdatamodel; sourceTree = ""; }; - F46F45BD1CFF0BEE00EB7F4D /* HMSlotDepriveCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HMSlotDepriveCommand.h; sourceTree = ""; }; - F46F45BE1CFF0BEE00EB7F4D /* HMSlotDepriveCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HMSlotDepriveCommand.m; sourceTree = ""; }; - F46F45C01CFF0CFF00EB7F4D /* HMSlotDepriveUnsetCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HMSlotDepriveUnsetCommand.h; sourceTree = ""; }; - F46F45C11CFF0CFF00EB7F4D /* HMSlotDepriveUnsetCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HMSlotDepriveUnsetCommand.m; sourceTree = ""; }; F47178491B6F9B5600F5E59D /* ResourceHistory.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = ResourceHistory.xcdatamodel; sourceTree = ""; }; F471784B1B6FA18800F5E59D /* HMKCResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HMKCResource.h; sourceTree = ""; }; F471784C1B6FA18800F5E59D /* HMKCResource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HMKCResource.m; sourceTree = ""; }; @@ -977,10 +975,8 @@ F402D5361BE3AFAB008D5881 /* HMSlotResetCommand.m */, F4F479241C074E9900D0BF69 /* HMCombinedCommand.h */, F4F479251C074E9900D0BF69 /* HMCombinedCommand.m */, - F46F45BD1CFF0BEE00EB7F4D /* HMSlotDepriveCommand.h */, - F46F45BE1CFF0BEE00EB7F4D /* HMSlotDepriveCommand.m */, - F46F45C01CFF0CFF00EB7F4D /* HMSlotDepriveUnsetCommand.h */, - F46F45C11CFF0CFF00EB7F4D /* HMSlotDepriveUnsetCommand.m */, + F44BC6E21E230577004644E3 /* HMSlotDepriveCommand.swift */, + F44BC6E01E2304E3004644E3 /* HMSlotDepriveUnsetCommand.swift */, ); name = FormationCommand; sourceTree = ""; @@ -1706,11 +1702,13 @@ F46F103618A7CE310063E503 /* HMJSONViewCommand.m in Sources */, F44BC6DF1E228770004644E3 /* HMQuestListCommand.swift in Sources */, F4F9F8701C6A306A00D0EE76 /* HMKCGuardEscaped.m in Sources */, + F44BC6E31E230577004644E3 /* HMSlotDepriveCommand.swift in Sources */, F4B3DC1E18DEB8C70011B4FC /* HMKenzoHistory.m in Sources */, F490977B1E19C3910085A45D /* HMSuppliesView.swift in Sources */, F4F9F86D1C6A306A00D0EE76 /* HMKCDamage+CoreDataProperties.m in Sources */, F4AA59341E1D2512001667AF /* HMSlotItemShortNameTransformer.swift in Sources */, F4F9F8771C6B5BA900D0EE76 /* HMKCKenzoDock+CoreDataProperties.m in Sources */, + F44BC6E11E2304E3004644E3 /* HMSlotDepriveUnsetCommand.swift in Sources */, F4A2AF5B1A0F9B490024BD9E /* HMScreenshotInformation.m in Sources */, F43769DE1AE1248800DE6204 /* HMAirBattleCommand.m in Sources */, F4AA593E1E1E0BFB001667AF /* HMDamageValueTransformer.swift in Sources */, @@ -1786,8 +1784,6 @@ F43F3D4C1A34AC8000D6DAF7 /* HMKCMasterShipObject.m in Sources */, F4268031194D1B1A00B2C27F /* HMChangeHenseiCommand.m in Sources */, F4BEEFE11B0B6326004702B8 /* HMDummyShipCommand.m in Sources */, - F46F45BF1CFF0BEE00EB7F4D /* HMSlotDepriveCommand.m in Sources */, - F46F45C21CFF0CFF00EB7F4D /* HMSlotDepriveUnsetCommand.m in Sources */, F4AA59441E1E300B001667AF /* HMActinKindTransformer.swift in Sources */, F4D05BCC1E0D274100688D66 /* HMBookmarkEditorViewController.swift in Sources */, F494DC6D18CC054800AE97E4 /* HMNyukyoDockStatus.m in Sources */, diff --git a/KCD/HMSlotDepriveCommand.h b/KCD/HMSlotDepriveCommand.h deleted file mode 100644 index f34292dd..00000000 --- a/KCD/HMSlotDepriveCommand.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// HMSlotDepriveCommand.h -// KCD -// -// Created by Hori,Masaki on 2016/06/01. -// Copyright © 2016年 Hori,Masaki. All rights reserved. -// - -#import "HMCompositCommand.h" - -@interface HMSlotDepriveCommand : HMCompositCommand - -@end diff --git a/KCD/HMSlotDepriveCommand.m b/KCD/HMSlotDepriveCommand.m deleted file mode 100644 index 1bd3efd4..00000000 --- a/KCD/HMSlotDepriveCommand.m +++ /dev/null @@ -1,38 +0,0 @@ -// -// HMSlotDepriveCommand.m -// KCD -// -// Created by Hori,Masaki on 2016/06/01. -// Copyright © 2016年 Hori,Masaki. All rights reserved. -// - -#import "HMSlotDepriveCommand.h" - -#import "HMMemberShipCommand.h" -#import "HMSlotDepriveUnsetCommand.h" - -@implementation HMSlotDepriveCommand -//+ (void)load -//{ -// static dispatch_once_t onceToken; -// dispatch_once(&onceToken, ^{ -// [HMJSONCommand registerClass:self]; -// }); -//} - -+ (BOOL)canExcuteAPI:(NSString *)api -{ - return [api isEqualToString:@"/kcsapi/api_req_kaisou/slot_deprive"]; -} - -- (instancetype)initWithAPIResponse:(HMAPIResponse *)apiResponse -{ - self = [super initWithAPIResponse:apiResponse - commandList: - @[ - [HMMemberShipCommand commandWithAPIResponse:apiResponse], - [HMSlotDepriveUnsetCommand commandWithAPIResponse:apiResponse], - ]]; - return self; -} -@end diff --git a/KCD/HMSlotDepriveCommand.swift b/KCD/HMSlotDepriveCommand.swift new file mode 100644 index 00000000..7f8a1203 --- /dev/null +++ b/KCD/HMSlotDepriveCommand.swift @@ -0,0 +1,24 @@ +// +// HMSlotDepriveCommand.swift +// KCD +// +// Created by Hori,Masaki on 2017/01/09. +// Copyright © 2017年 Hori,Masaki. All rights reserved. +// + +import Cocoa + +class HMSlotDepriveCommand: HMCompositCommand { + override init(apiResponse: HMAPIResponse) { + super.init(apiResponse: apiResponse, commandList: + [ + HMMemberShipCommand(apiResponse: apiResponse), + HMSlotDepriveUnsetCommand(apiResponse: apiResponse), + ] + ) + } + override class func canExcuteAPI(_ api: String) -> Bool { + if api == "/kcsapi/api_req_kaisou/slot_deprive" { return true } + return false + } +} diff --git a/KCD/HMSlotDepriveUnsetCommand.h b/KCD/HMSlotDepriveUnsetCommand.h deleted file mode 100644 index c70892ff..00000000 --- a/KCD/HMSlotDepriveUnsetCommand.h +++ /dev/null @@ -1,12 +0,0 @@ -// -// HMSlotDepriveUnsetCommand.h -// KCD -// -// Created by Hori,Masaki on 2016/06/01. -// Copyright © 2016年 Hori,Masaki. All rights reserved. -// - -#import "HMMemberShipCommand.h" - -@interface HMSlotDepriveUnsetCommand : HMMemberShipCommand -@end diff --git a/KCD/HMSlotDepriveUnsetCommand.m b/KCD/HMSlotDepriveUnsetCommand.m deleted file mode 100644 index ac557ca2..00000000 --- a/KCD/HMSlotDepriveUnsetCommand.m +++ /dev/null @@ -1,16 +0,0 @@ -// -// HMSlotDepriveUnsetCommand.m -// KCD -// -// Created by Hori,Masaki on 2016/06/01. -// Copyright © 2016年 Hori,Masaki. All rights reserved. -// - -#import "HMSlotDepriveUnsetCommand.h" - -@implementation HMSlotDepriveUnsetCommand -- (NSString *)dataKey -{ - return @"api_data.api_ship_data.api_unset_ship"; -} -@end diff --git a/KCD/HMSlotDepriveUnsetCommand.swift b/KCD/HMSlotDepriveUnsetCommand.swift new file mode 100644 index 00000000..ed1c7001 --- /dev/null +++ b/KCD/HMSlotDepriveUnsetCommand.swift @@ -0,0 +1,13 @@ +// +// HMSlotDepriveUnsetCommand.swift +// KCD +// +// Created by Hori,Masaki on 2017/01/09. +// Copyright © 2017年 Hori,Masaki. All rights reserved. +// + +import Cocoa + +class HMSlotDepriveUnsetCommand: HMMemberShipCommand { + override var dataKey: String { return "api_data.api_ship_data.api_unset_ship" } +} diff --git a/KCD/KCD-Bridging-Header.h b/KCD/KCD-Bridging-Header.h index dc35ed57..0093fa48 100644 --- a/KCD/KCD-Bridging-Header.h +++ b/KCD/KCD-Bridging-Header.h @@ -60,7 +60,6 @@ #import "HMKaisouLockCommand.h" #import "HMSlotResetCommand.h" #import "HMCombinedCommand.h" -#import "HMSlotDepriveCommand.h" #import "HMResetSortieCommand.h" #import "HMDropShipHistoryCommand.h" #import "HMDummyShipCommand.h" -- 2.11.0