From 7bef3a19efba5f1a572de2e0aa7e4b806f85bdcc Mon Sep 17 00:00:00 2001 From: masakih Date: Tue, 10 Jan 2017 21:43:25 +0900 Subject: [PATCH] =?utf8?q?HMCreateSlotItemCommand=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 --- KCD.xcodeproj/project.pbxproj | 10 ++++----- KCD/HMCreateSlotItemCommand.h | 13 ----------- KCD/HMCreateSlotItemCommand.m | 47 --------------------------------------- KCD/HMCreateSlotItemCommand.swift | 30 +++++++++++++++++++++++++ KCD/KCD-Bridging-Header.h | 4 ++-- 5 files changed, 36 insertions(+), 68 deletions(-) delete mode 100644 KCD/HMCreateSlotItemCommand.h delete mode 100644 KCD/HMCreateSlotItemCommand.m create mode 100644 KCD/HMCreateSlotItemCommand.swift diff --git a/KCD.xcodeproj/project.pbxproj b/KCD.xcodeproj/project.pbxproj index c7ca21a0..81212e57 100644 --- a/KCD.xcodeproj/project.pbxproj +++ b/KCD.xcodeproj/project.pbxproj @@ -70,6 +70,7 @@ F44BC6F71E23DA4A004644E3 /* HMDestroyShipCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = F44BC6F61E23DA4A004644E3 /* HMDestroyShipCommand.swift */; }; F44BC6F91E23DAC5004644E3 /* HMRealDestroyShipCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = F44BC6F81E23DAC5004644E3 /* HMRealDestroyShipCommand.swift */; }; F44BC6FD1E250B2A004644E3 /* HMGetShipCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = F44BC6FC1E250B2A004644E3 /* HMGetShipCommand.swift */; }; + F44BC6FF1E250CED004644E3 /* HMCreateSlotItemCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = F44BC6FE1E250CED004644E3 /* HMCreateSlotItemCommand.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 */; }; @@ -173,7 +174,6 @@ F4AC13711E096A7B00851147 /* HMHistoryWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4AC13701E096A7B00851147 /* HMHistoryWindowController.swift */; }; F4B15CBD1E21BA870078CFFC /* CommandRegister.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4B15CBC1E21BA870078CFFC /* CommandRegister.swift */; }; F4B37EFF19FC8DCC002F371A /* HMUpgradableShipsWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F4B37F0119FC8DCC002F371A /* HMUpgradableShipsWindowController.xib */; }; - F4B3DBCA18DDB9170011B4FC /* HMCreateSlotItemCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = F4B3DBC918DDB9170011B4FC /* HMCreateSlotItemCommand.m */; }; F4B3DC1B18DEAB5E0011B4FC /* HMKaihatuHistory.m in Sources */ = {isa = PBXBuildFile; fileRef = F4B3DC1A18DEAB5E0011B4FC /* HMKaihatuHistory.m */; }; F4B3DC1E18DEB8C70011B4FC /* HMKenzoHistory.m in Sources */ = {isa = PBXBuildFile; fileRef = F4B3DC1D18DEB8C70011B4FC /* HMKenzoHistory.m */; }; F4B3DC2118DECF570011B4FC /* HMTSVSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = F4B3DC2018DECF570011B4FC /* HMTSVSupport.m */; }; @@ -410,6 +410,7 @@ F44BC6F61E23DA4A004644E3 /* HMDestroyShipCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMDestroyShipCommand.swift; sourceTree = ""; }; F44BC6F81E23DAC5004644E3 /* HMRealDestroyShipCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMRealDestroyShipCommand.swift; sourceTree = ""; }; F44BC6FC1E250B2A004644E3 /* HMGetShipCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMGetShipCommand.swift; sourceTree = ""; }; + F44BC6FE1E250CED004644E3 /* HMCreateSlotItemCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMCreateSlotItemCommand.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 = ""; }; @@ -557,8 +558,6 @@ F4AC136E1E0963DB00851147 /* HMProgressPanel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMProgressPanel.swift; sourceTree = ""; }; F4AC13701E096A7B00851147 /* HMHistoryWindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMHistoryWindowController.swift; sourceTree = ""; }; F4B15CBC1E21BA870078CFFC /* CommandRegister.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CommandRegister.swift; sourceTree = ""; }; - F4B3DBC818DDB9170011B4FC /* HMCreateSlotItemCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HMCreateSlotItemCommand.h; sourceTree = ""; }; - F4B3DBC918DDB9170011B4FC /* HMCreateSlotItemCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HMCreateSlotItemCommand.m; sourceTree = ""; }; F4B3DC1918DEAB5E0011B4FC /* HMKaihatuHistory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HMKaihatuHistory.h; sourceTree = ""; }; F4B3DC1A18DEAB5E0011B4FC /* HMKaihatuHistory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HMKaihatuHistory.m; sourceTree = ""; }; F4B3DC1C18DEB8C70011B4FC /* HMKenzoHistory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HMKenzoHistory.h; sourceTree = ""; }; @@ -929,8 +928,7 @@ F4649FC41DBBB4590097AEBF /* ArsenalCommand */ = { isa = PBXGroup; children = ( - F4B3DBC818DDB9170011B4FC /* HMCreateSlotItemCommand.h */, - F4B3DBC918DDB9170011B4FC /* HMCreateSlotItemCommand.m */, + F44BC6FE1E250CED004644E3 /* HMCreateSlotItemCommand.swift */, F44BC6FC1E250B2A004644E3 /* HMGetShipCommand.swift */, F44BC6F41E23D593004644E3 /* HMPowerUpCommand.swift */, F44BC6F21E23D32B004644E3 /* HMRealPowerUpCommand.swift */, @@ -1798,7 +1796,6 @@ F4513EDD18B619B600073552 /* HMCoreDataManager.m in Sources */, F4E90B5E1DE713FF00643B5F /* HMSetPlaneCommand.m in Sources */, F45FBB921E129BAE000E72B9 /* HMFleetViewController.swift in Sources */, - F4B3DBCA18DDB9170011B4FC /* HMCreateSlotItemCommand.m in Sources */, F4131ED8190FA08D004F7F9A /* HMDestroyItem2Command.m in Sources */, F48A705E1DE58A38005DFC0B /* HMKCAirBasePlaneInfo+CoreDataClass.m in Sources */, F4AA59501E1E4D18001667AF /* HMShipWindowController.swift in Sources */, @@ -1816,6 +1813,7 @@ F4E5FF0A1E15CE3D0026868C /* HMBridgeViewController.swift in Sources */, F4AA060D1930E69200844688 /* HMMidnightBattleCommand.m in Sources */, F4D6BC551A93903E00742FEB /* HMDropShipHistory.m in Sources */, + F44BC6FF1E250CED004644E3 /* HMCreateSlotItemCommand.swift in Sources */, F4BDEB5A187252F30069D0CE /* HMAppDelegate.m in Sources */, F4AA59461E1E33ED001667AF /* HMAreaNameTransformer.swift in Sources */, F4AA59301E1D1FAB001667AF /* HMLengTransformer.swift in Sources */, diff --git a/KCD/HMCreateSlotItemCommand.h b/KCD/HMCreateSlotItemCommand.h deleted file mode 100644 index bbb85fcf..00000000 --- a/KCD/HMCreateSlotItemCommand.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// HMCreateSlotItemCommand.h -// KCD -// -// Created by Hori,Masaki on 2014/03/22. -// Copyright (c) 2014年 Hori,Masaki. All rights reserved. -// - -#import "HMCompositCommand.h" - -@interface HMCreateSlotItemCommand : HMCompositCommand - -@end diff --git a/KCD/HMCreateSlotItemCommand.m b/KCD/HMCreateSlotItemCommand.m deleted file mode 100644 index caf3c70f..00000000 --- a/KCD/HMCreateSlotItemCommand.m +++ /dev/null @@ -1,47 +0,0 @@ -// -// HMCreateSlotItemCommand.m -// KCD -// -// Created by Hori,Masaki on 2014/03/22. -// Copyright (c) 2014年 Hori,Masaki. All rights reserved. -// - -#import "HMCreateSlotItemCommand.h" - -#import "HMMemberMaterialCommand.h" -#import "HMUpdateSlotItemCommand.h" -#import "HMStoreCreateSlotItemHistoryCommand.h" - - -@implementation HMCreateSlotItemCommand -//+ (void)load -//{ -// static dispatch_once_t onceToken; -// dispatch_once(&onceToken, ^{ -// [HMJSONCommand registerClass:self]; -// }); -//} - -+ (BOOL)canExcuteAPI:(NSString *)api -{ - if([api isEqualToString:@"/kcsapi/api_req_kousyou/createitem"]) return YES; - - return NO; -} -- (instancetype)initWithAPIResponse:(HMAPIResponse *)apiResponse -{ - self = [super initWithAPIResponse:apiResponse - commandList: - @[ - [HMMemberMaterialCommand commandWithAPIResponse:apiResponse], - [HMUpdateSlotItemCommand commandWithAPIResponse:apiResponse], - [HMStoreCreateSlotItemHistoryCommand commandWithAPIResponse:apiResponse], - ]]; - return self; -} -- (void)execute -{ - [NSThread sleepForTimeInterval:6.5]; - [super execute]; -} -@end diff --git a/KCD/HMCreateSlotItemCommand.swift b/KCD/HMCreateSlotItemCommand.swift new file mode 100644 index 00000000..60dcfc6c --- /dev/null +++ b/KCD/HMCreateSlotItemCommand.swift @@ -0,0 +1,30 @@ +// +// HMCreateSlotItemCommand.swift +// KCD +// +// Created by Hori,Masaki on 2017/01/10. +// Copyright © 2017年 Hori,Masaki. All rights reserved. +// + +import Cocoa + +class HMCreateSlotItemCommand: HMCompositCommand { + override init(apiResponse: HMAPIResponse) { + super.init(apiResponse: apiResponse, commandList: + [ + HMMemberMaterialCommand(apiResponse: apiResponse), + HMUpdateSlotItemCommand(apiResponse: apiResponse), + HMStoreCreateSlotItemHistoryCommand(apiResponse: apiResponse), + ] + ) + } + override class func canExcuteAPI(_ api: String) -> Bool { + if api == "/kcsapi/api_req_kousyou/createitem" { return true } + return false + } + + override func execute() { + Thread.sleep(forTimeInterval: 6.5) + super.execute() + } +} diff --git a/KCD/KCD-Bridging-Header.h b/KCD/KCD-Bridging-Header.h index 6f4d3b0a..20429ede 100644 --- a/KCD/KCD-Bridging-Header.h +++ b/KCD/KCD-Bridging-Header.h @@ -50,12 +50,12 @@ #import "HMMapInfoCommand.h" #import "HMSetPlaneCommand.h" #import "HMSetActionCommand.h" -#import "HMCreateSlotItemCommand.h" #import "HMResetSortieCommand.h" #import "HMDropShipHistoryCommand.h" #import "HMDummyShipCommand.h" #import "HMKenzoMarkCommand.h" - +#import "HMUpdateSlotItemCommand.h" +#import "HMStoreCreateSlotItemHistoryCommand.h" // Core Data #import "HMBookmarkManager.h" -- 2.11.0