From 428565a4bf2d42e146ee1858bf8d8091c95929e7 Mon Sep 17 00:00:00 2001 From: masakih Date: Wed, 18 Jan 2017 23:48:07 +0900 Subject: [PATCH] =?utf8?q?HMMapStartCommand=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/HMCombinedBattleCommand.swift | 2 +- KCD/HMMapStartCommand.h | 13 ------------- KCD/HMMapStartCommand.m | 41 --------------------------------------- KCD/HMMapStartCommand.swift | 25 ++++++++++++++++++++++++ KCD/KCD-Bridging-Header.h | 2 +- 6 files changed, 31 insertions(+), 62 deletions(-) delete mode 100644 KCD/HMMapStartCommand.h delete mode 100644 KCD/HMMapStartCommand.m create mode 100644 KCD/HMMapStartCommand.swift diff --git a/KCD.xcodeproj/project.pbxproj b/KCD.xcodeproj/project.pbxproj index f92d1375..eb9bd232 100644 --- a/KCD.xcodeproj/project.pbxproj +++ b/KCD.xcodeproj/project.pbxproj @@ -150,6 +150,7 @@ F4A0D70F1E2FA42800224DCE /* HMBattleResultCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4A0D70E1E2FA42800224DCE /* HMBattleResultCommand.swift */; }; F4A0D7111E2FA5AF00224DCE /* HMMidnightBattleCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4A0D7101E2FA5AF00224DCE /* HMMidnightBattleCommand.swift */; }; F4A0D7131E2FAEF800224DCE /* HMBattleCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4A0D7121E2FAEF800224DCE /* HMBattleCommand.swift */; }; + F4A0D7151E2FB11F00224DCE /* HMMapStartCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4A0D7141E2FB11F00224DCE /* HMMapStartCommand.swift */; }; F4A2AF581A0930160024BD9E /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F4A2AF571A0930160024BD9E /* Quartz.framework */; }; F4A2AF5B1A0F9B490024BD9E /* HMScreenshotInformation.m in Sources */ = {isa = PBXBuildFile; fileRef = F4A2AF5A1A0F9B490024BD9E /* HMScreenshotInformation.m */; }; F4A3AD8B19B9BE7A00FDBF80 /* HMMaskSelectView.m in Sources */ = {isa = PBXBuildFile; fileRef = F4A3AD8A19B9BE7A00FDBF80 /* HMMaskSelectView.m */; }; @@ -160,7 +161,6 @@ F4A9B8D91BA40ED1005786C2 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = F4A9B8D81BA40ED1005786C2 /* LICENSE */; }; F4A9E7FB1D045BC100F91746 /* HMScreenshotModel.m in Sources */ = {isa = PBXBuildFile; fileRef = F4A9E7F61D045BC100F91746 /* HMScreenshotModel.m */; }; F4AA05FB192B92C800844688 /* Temporary.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = F4AA05F9192B92C700844688 /* Temporary.xcdatamodeld */; }; - F4AA0607192E3B6200844688 /* HMMapStartCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = F4AA0606192E3B6200844688 /* HMMapStartCommand.m */; }; F4AA59141E1C951F001667AF /* HMTimerCountFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4AA59131E1C951F001667AF /* HMTimerCountFormatter.swift */; }; F4AA59161E1C9C5D001667AF /* ValueTransformerRegister.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4AA59151E1C9C5D001667AF /* ValueTransformerRegister.swift */; }; F4AA591A1E1CE2EA001667AF /* HMSlotItemEquipTypeTransformer.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4AA59191E1CE2EA001667AF /* HMSlotItemEquipTypeTransformer.swift */; }; @@ -507,6 +507,7 @@ F4A0D70E1E2FA42800224DCE /* HMBattleResultCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMBattleResultCommand.swift; sourceTree = ""; }; F4A0D7101E2FA5AF00224DCE /* HMMidnightBattleCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMMidnightBattleCommand.swift; sourceTree = ""; }; F4A0D7121E2FAEF800224DCE /* HMBattleCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMBattleCommand.swift; sourceTree = ""; }; + F4A0D7141E2FB11F00224DCE /* HMMapStartCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMMapStartCommand.swift; sourceTree = ""; }; F4A2AF571A0930160024BD9E /* Quartz.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quartz.framework; path = System/Library/Frameworks/Quartz.framework; sourceTree = SDKROOT; }; F4A2AF591A0F9B490024BD9E /* HMScreenshotInformation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HMScreenshotInformation.h; sourceTree = ""; }; F4A2AF5A1A0F9B490024BD9E /* HMScreenshotInformation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HMScreenshotInformation.m; sourceTree = ""; }; @@ -520,8 +521,6 @@ F4A9E7F51D045BC100F91746 /* HMScreenshotModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HMScreenshotModel.h; sourceTree = ""; }; F4A9E7F61D045BC100F91746 /* HMScreenshotModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HMScreenshotModel.m; sourceTree = ""; }; F4AA05FA192B92C800844688 /* Temporary.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Temporary.xcdatamodel; sourceTree = ""; }; - F4AA0605192E3B6200844688 /* HMMapStartCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HMMapStartCommand.h; sourceTree = ""; }; - F4AA0606192E3B6200844688 /* HMMapStartCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HMMapStartCommand.m; sourceTree = ""; }; F4AA59131E1C951F001667AF /* HMTimerCountFormatter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMTimerCountFormatter.swift; sourceTree = ""; }; F4AA59151E1C9C5D001667AF /* ValueTransformerRegister.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueTransformerRegister.swift; sourceTree = ""; }; F4AA59191E1CE2EA001667AF /* HMSlotItemEquipTypeTransformer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMSlotItemEquipTypeTransformer.swift; sourceTree = ""; }; @@ -827,8 +826,7 @@ F4649FC31DBBB3B00097AEBF /* BattleCommand */ = { isa = PBXGroup; children = ( - F4AA0605192E3B6200844688 /* HMMapStartCommand.h */, - F4AA0606192E3B6200844688 /* HMMapStartCommand.m */, + F4A0D7141E2FB11F00224DCE /* HMMapStartCommand.swift */, F4A0D7121E2FAEF800224DCE /* HMBattleCommand.swift */, F4A0D7101E2FA5AF00224DCE /* HMMidnightBattleCommand.swift */, F4A0D70E1E2FA42800224DCE /* HMBattleResultCommand.swift */, @@ -1574,7 +1572,6 @@ F4BEEFE91B0CE312004702B8 /* HMAPIResponse.m in Sources */, F4AA592A1E1D1387001667AF /* HMIgnoreZeroTransformer.swift in Sources */, F4AC136D1E0802C000851147 /* HMPreferencePanelController.swift in Sources */, - F4AA0607192E3B6200844688 /* HMMapStartCommand.m in Sources */, F44BC6E91E232B15004644E3 /* HMKaisouLockCommand.swift in Sources */, F44BC6EF1E239FB1004644E3 /* HMRemodelSlotCommand.swift in Sources */, F4D2CBC518AE2AE2000EBC59 /* HMCompositCommand.m in Sources */, @@ -1607,6 +1604,7 @@ F44BC6E71E231534004644E3 /* HMSlotResetCommand.swift in Sources */, F4AA59321E1D211C001667AF /* HMSlotitemNameTransformer.swift in Sources */, F48A705F1DE58A38005DFC0B /* HMKCAirBasePlaneInfo+CoreDataProperties.m in Sources */, + F4A0D7151E2FB11F00224DCE /* HMMapStartCommand.swift in Sources */, F44BC6E51E23082B004644E3 /* HMCombinedCommand.swift in Sources */, F4AA59401E1E23EC001667AF /* HMHistoryMarkTransformer.swift in Sources */, F44BC7131E28FDC4004644E3 /* HMMemberShipCommand.swift in Sources */, diff --git a/KCD/HMCombinedBattleCommand.swift b/KCD/HMCombinedBattleCommand.swift index a01479dd..1cd5f4df 100644 --- a/KCD/HMCombinedBattleCommand.swift +++ b/KCD/HMCombinedBattleCommand.swift @@ -13,7 +13,7 @@ class HMCombinedBattleCommand: HMCompositCommand { super.init(apiResponse: apiResponse, commandList: [ HMCalculateDamageCommand(apiResponse: apiResponse), - ] + ] ) } override class func canExcuteAPI(_ api: String) -> Bool { diff --git a/KCD/HMMapStartCommand.h b/KCD/HMMapStartCommand.h deleted file mode 100644 index 9abd4d3c..00000000 --- a/KCD/HMMapStartCommand.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// HMMapStartCommand.h -// KCD -// -// Created by Hori,Masaki on 2014/05/22. -// Copyright (c) 2014年 Hori,Masaki. All rights reserved. -// - -#import "HMCompositCommand.h" - -@interface HMMapStartCommand : HMCompositCommand - -@end diff --git a/KCD/HMMapStartCommand.m b/KCD/HMMapStartCommand.m deleted file mode 100644 index c23da657..00000000 --- a/KCD/HMMapStartCommand.m +++ /dev/null @@ -1,41 +0,0 @@ -// -// HMMapStartCommand.m -// KCD -// -// Created by Hori,Masaki on 2014/05/22. -// Copyright (c) 2014年 Hori,Masaki. All rights reserved. -// - -#import "HMMapStartCommand.h" - -#import "KCD-Swift.h" - - -@implementation HMMapStartCommand -//+ (void)load -//{ -// static dispatch_once_t onceToken; -// dispatch_once(&onceToken, ^{ -// [HMJSONCommand registerClass:self]; -// }); -//} - -+ (BOOL)canExcuteAPI:(NSString *)api -{ - if([api isEqualToString:@"/kcsapi/api_req_map/start"]) return YES; - if([api isEqualToString:@"/kcsapi/api_req_map/next"]) return YES; - - return NO; -} - -- (instancetype)initWithAPIResponse:(HMAPIResponse *)apiResponse -{ - self = [super initWithAPIResponse:apiResponse - commandList: - @[ - [HMCalculateDamageCommand commandWithAPIResponse:apiResponse], - [HMGuardShelterCommand commandWithAPIResponse:apiResponse], - ]]; - return self; -} -@end diff --git a/KCD/HMMapStartCommand.swift b/KCD/HMMapStartCommand.swift new file mode 100644 index 00000000..ab3d1a93 --- /dev/null +++ b/KCD/HMMapStartCommand.swift @@ -0,0 +1,25 @@ +// +// HMMapStartCommand.swift +// KCD +// +// Created by Hori,Masaki on 2017/01/18. +// Copyright © 2017年 Hori,Masaki. All rights reserved. +// + +import Cocoa + +class HMMapStartCommand: HMCompositCommand { + override init(apiResponse: HMAPIResponse) { + super.init(apiResponse: apiResponse, commandList: + [ + HMCalculateDamageCommand(apiResponse: apiResponse), + HMGuardShelterCommand(apiResponse: apiResponse), + ] + ) + } + override class func canExcuteAPI(_ api: String) -> Bool { + if api == "/kcsapi/api_req_map/start" { return true } + if api == "/kcsapi/api_req_map/next" { return true } + return false + } +} diff --git a/KCD/KCD-Bridging-Header.h b/KCD/KCD-Bridging-Header.h index 1eb6c61c..14995ea0 100644 --- a/KCD/KCD-Bridging-Header.h +++ b/KCD/KCD-Bridging-Header.h @@ -26,8 +26,8 @@ // Command #import "HMJSONCommand.h" +#import "HMCompositCommand.h" -#import "HMMapStartCommand.h" // Core Data #import "HMBookmarkManager.h" -- 2.11.0