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 */; };
+ F4A0D7171E2FB7E000224DCE /* HMCompositCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4A0D7161E2FB7E000224DCE /* HMCompositCommand.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 */; };
F4D05BDB1E0F76A800688D66 /* HMResourceViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4D05BDA1E0F76A800688D66 /* HMResourceViewController.swift */; };
F4D05BDF1E0F8B6900688D66 /* HMPowerUpSupportViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4D05BDE1E0F8B6900688D66 /* HMPowerUpSupportViewController.swift */; };
F4D05BE11E0FAB8E00688D66 /* HMShipViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4D05BE01E0FAB8E00688D66 /* HMShipViewController.swift */; };
- F4D2CBC518AE2AE2000EBC59 /* HMCompositCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = F4D2CBC418AE2AE2000EBC59 /* HMCompositCommand.m */; };
F4D2CBC818B0555A000EBC59 /* HMKCManagedObject.m in Sources */ = {isa = PBXBuildFile; fileRef = F4D2CBC718B0555A000EBC59 /* HMKCManagedObject.m */; };
F4D6BC551A93903E00742FEB /* HMDropShipHistory.m in Sources */ = {isa = PBXBuildFile; fileRef = F4D6BC541A93903E00742FEB /* HMDropShipHistory.m */; };
F4E5FF021E150A850026868C /* HMAncherageRepairTimerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4E5FF011E150A850026868C /* HMAncherageRepairTimerViewController.swift */; };
F4A0D7101E2FA5AF00224DCE /* HMMidnightBattleCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMMidnightBattleCommand.swift; sourceTree = "<group>"; };
F4A0D7121E2FAEF800224DCE /* HMBattleCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMBattleCommand.swift; sourceTree = "<group>"; };
F4A0D7141E2FB11F00224DCE /* HMMapStartCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMMapStartCommand.swift; sourceTree = "<group>"; };
+ F4A0D7161E2FB7E000224DCE /* HMCompositCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMCompositCommand.swift; sourceTree = "<group>"; };
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 = "<group>"; };
F4A2AF5A1A0F9B490024BD9E /* HMScreenshotInformation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HMScreenshotInformation.m; sourceTree = "<group>"; };
F4D05BDA1E0F76A800688D66 /* HMResourceViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMResourceViewController.swift; sourceTree = "<group>"; };
F4D05BDE1E0F8B6900688D66 /* HMPowerUpSupportViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMPowerUpSupportViewController.swift; sourceTree = "<group>"; };
F4D05BE01E0FAB8E00688D66 /* HMShipViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMShipViewController.swift; sourceTree = "<group>"; };
- F4D2CBC318AE2AE2000EBC59 /* HMCompositCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HMCompositCommand.h; sourceTree = "<group>"; };
- F4D2CBC418AE2AE2000EBC59 /* HMCompositCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HMCompositCommand.m; sourceTree = "<group>"; };
F4D2CBC618B0555A000EBC59 /* HMKCManagedObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HMKCManagedObject.h; sourceTree = "<group>"; };
F4D2CBC718B0555A000EBC59 /* HMKCManagedObject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HMKCManagedObject.m; sourceTree = "<group>"; };
F4D6BC4C1A923C0B00742FEB /* LocalData 2.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "LocalData 2.xcdatamodel"; sourceTree = "<group>"; };
F4B15CBC1E21BA870078CFFC /* CommandRegister.swift */,
F4C1190918A74DF0005D5B25 /* HMJSONCommand.h */,
F4C1190A18A74DF0005D5B25 /* HMJSONCommand.m */,
- F4D2CBC318AE2AE2000EBC59 /* HMCompositCommand.h */,
- F4D2CBC418AE2AE2000EBC59 /* HMCompositCommand.m */,
+ F4A0D7161E2FB7E000224DCE /* HMCompositCommand.swift */,
F44BC6D01E224299004644E3 /* HMPortCommand.swift */,
F44BC6CA1E223208004644E3 /* HMIgnoreCommand.swift */,
F44BC6C81E22314B004644E3 /* HMUnknownComand.swift */,
F4AC136D1E0802C000851147 /* HMPreferencePanelController.swift in Sources */,
F44BC6E91E232B15004644E3 /* HMKaisouLockCommand.swift in Sources */,
F44BC6EF1E239FB1004644E3 /* HMRemodelSlotCommand.swift in Sources */,
- F4D2CBC518AE2AE2000EBC59 /* HMCompositCommand.m in Sources */,
F4F9F89B1C6CB7D400D0EE76 /* HMFleet.m in Sources */,
F48A705D1DE58A38005DFC0B /* HMKCAirBase+CoreDataProperties.m in Sources */,
F4AA59161E1C9C5D001667AF /* ValueTransformerRegister.swift in Sources */,
F44BC72F1E2A0B75004644E3 /* HMMaserShipCommand.swift in Sources */,
F44BC7271E29ED87004644E3 /* HMMasterUseItemCommand.swift in Sources */,
F4F9F8711C6A306A00D0EE76 /* HMKCBattle+CoreDataProperties.m in Sources */,
+ F4A0D7171E2FB7E000224DCE /* HMCompositCommand.swift in Sources */,
F44BC7011E251408004644E3 /* HMDestroyItem2Command.swift in Sources */,
F45FBB731E116F53000E72B9 /* HMMainTabVIewItemViewController.swift in Sources */,
F4F9F8A61C78596900D0EE76 /* HMAnchorageRepairManager.m in Sources */,
import Cocoa
class HMAirBattleCommand: HMCompositCommand {
- override init(apiResponse: HMAPIResponse) {
+ required init(apiResponse: HMAPIResponse) {
super.init(apiResponse: apiResponse, commandList:
[
HMDropShipHistoryCommand(apiResponse: apiResponse),
import Cocoa
class HMBattleCommand: HMCompositCommand {
- override init(apiResponse: HMAPIResponse) {
+ required init(apiResponse: HMAPIResponse) {
super.init(apiResponse: apiResponse, commandList:
[
HMCalculateDamageCommand(apiResponse: apiResponse),
import Cocoa
class HMBattleResultCommand: HMCompositCommand {
- override init(apiResponse: HMAPIResponse) {
+ required init(apiResponse: HMAPIResponse) {
super.init(apiResponse: apiResponse, commandList:
[
HMDropShipHistoryCommand(apiResponse: apiResponse),
import Cocoa
class HMClearItemGetComand: HMCompositCommand {
- override init(apiResponse: HMAPIResponse) {
+ required init(apiResponse: HMAPIResponse) {
super.init(apiResponse: apiResponse, commandList:
[
HMUpdateQuestListCommand(apiResponse: apiResponse),
import Cocoa
class HMCombinedBattleCommand: HMCompositCommand {
- override init(apiResponse: HMAPIResponse) {
+ required init(apiResponse: HMAPIResponse) {
super.init(apiResponse: apiResponse, commandList:
[
HMCalculateDamageCommand(apiResponse: apiResponse),
+++ /dev/null
-//
-// HMCompositCommand.h
-// KCD
-//
-// Created by Hori,Masaki on 2014/02/14.
-// Copyright (c) 2014年 Hori,Masaki. All rights reserved.
-//
-
-#import "HMJSONCommand.h"
-
-@interface HMCompositCommand : HMJSONCommand
-
-+ (instancetype)compositCommandWithAPIResponse:(HMAPIResponse *)apiResponse commandList:(NSArray<HMJSONCommand *> *)commands;
-- (instancetype)initWithAPIResponse:(HMAPIResponse *)apiResponse commandList:(NSArray<HMJSONCommand *> *)commandList;
-@end
+++ /dev/null
-//
-// HMCompositCommand.m
-// KCD
-//
-// Created by Hori,Masaki on 2014/02/14.
-// Copyright (c) 2014年 Hori,Masaki. All rights reserved.
-//
-
-#import "HMCompositCommand.h"
-
-@interface HMCompositCommand ()
-@property (nonatomic, strong) NSMutableArray *commands;
-@end
-
-@implementation HMCompositCommand
-
-+ (instancetype)compositCommandWithAPIResponse:(HMAPIResponse *)apiResponse commandList:(NSArray<HMJSONCommand *> *)commands
-{
- return [[self alloc] initWithAPIResponse:apiResponse commandList:commands];
-}
-- (instancetype)initWithAPIResponse:(HMAPIResponse *)apiResponse commandList:(NSArray<HMJSONCommand *> *)commandList
-{
- self = [super initWithAPIResponse:apiResponse];
- if(self) {
- _commands = [commandList copy];
- }
- return self;
-}
-
-- (void)execute
-{
- for(HMJSONCommand *command in self.commands) {
- [command execute];
- }
-}
-
-- (void)setApi:(NSString *)api
-{
- for(id command in self.commands) {
- [command setApi:api];
- }
-}
-- (void)setRecieveDate:(NSDate *)recieveDate
-{
- for(id command in self.commands) {
- [command setRecieveDate:recieveDate];
- }
-}
-
-- (void)setJson:(id)json
-{
- for(id command in self.commands) {
- [command setJson:json];
- }
-}
-- (void)setArguments:(NSDictionary *)arguments
-{
- for(id command in self.commands) {
- [command setArguments:arguments];
- }
-}
-
-
-@end
--- /dev/null
+//
+// HMCompositCommand.swift
+// KCD
+//
+// Created by Hori,Masaki on 2017/01/18.
+// Copyright © 2017年 Hori,Masaki. All rights reserved.
+//
+
+import Cocoa
+
+class HMCompositCommand: HMJSONCommand {
+
+ init(apiResponse: HMAPIResponse, commandList: [HMJSONCommand]) {
+ commands = commandList
+ super.init(apiResponse: apiResponse)
+ }
+ required override convenience init(apiResponse: HMAPIResponse) {
+ self.init(apiResponse: apiResponse, commandList: [])
+ }
+ private let commands: [HMJSONCommand]
+
+ override func execute() {
+ commands.forEach { $0.execute() }
+ }
+}
import Cocoa
class HMCreateSlotItemCommand: HMCompositCommand {
- override init(apiResponse: HMAPIResponse) {
+ required init(apiResponse: HMAPIResponse) {
super.init(apiResponse: apiResponse, commandList:
[
HMMemberMaterialCommand(apiResponse: apiResponse),
import Cocoa
class HMDestroyShipCommand: HMCompositCommand {
- override init(apiResponse: HMAPIResponse) {
+ required init(apiResponse: HMAPIResponse) {
super.init(apiResponse: apiResponse, commandList:
[
HMMemberMaterialCommand(apiResponse: apiResponse),
import Cocoa
class HMGetShipCommand: HMCompositCommand {
- override init(apiResponse: HMAPIResponse) {
+ required init(apiResponse: HMAPIResponse) {
super.init(apiResponse: apiResponse, commandList:
[
HMMemberSlotItemCommand(apiResponse: apiResponse),
import Cocoa
class HMHokyuChargeCommand: HMCompositCommand {
- override init(apiResponse: HMAPIResponse) {
+ required init(apiResponse: HMAPIResponse) {
super.init(apiResponse: apiResponse, commandList:
[
HMMemberMaterialCommand(apiResponse: apiResponse),
#import "HMAppDelegate.h"
#if ENABLE_JSON_LOG
-#import "HMCompositCommand.h"
#import "HMJSONViewCommand.h"
#endif
}
viewCommand.recieveDate = apiResult.date;
- command = [HMCompositCommand compositCommandWithAPIResponse:apiResult
+ command = [[HMCompositCommand alloc] initWithApiResponse: apiResult
commandList: @[
command,
viewCommand,
import Cocoa
class HMMapInfoCommand: HMCompositCommand {
- override init(apiResponse: HMAPIResponse) {
+ required init(apiResponse: HMAPIResponse) {
super.init(apiResponse: apiResponse, commandList:
[
HMAirBaseCommand(apiResponse: apiResponse),
import Cocoa
class HMMapStartCommand: HMCompositCommand {
- override init(apiResponse: HMAPIResponse) {
+ required init(apiResponse: HMAPIResponse) {
super.init(apiResponse: apiResponse, commandList:
[
HMCalculateDamageCommand(apiResponse: apiResponse),
import Cocoa
class HMMemberRequireInfoCommand: HMCompositCommand {
- override init(apiResponse: HMAPIResponse) {
+ required init(apiResponse: HMAPIResponse) {
super.init(apiResponse: apiResponse, commandList:
[
HMMemberSlotItemCommand(apiResponse: apiResponse),
import Cocoa
class HMMemberShip2Command: HMCompositCommand {
- override init(apiResponse: HMAPIResponse) {
+ required init(apiResponse: HMAPIResponse) {
super.init(apiResponse: apiResponse, commandList:
[
HMMemberShipCommand(apiResponse: apiResponse),
import Cocoa
class HMMemberShip3Command: HMCompositCommand {
- override init(apiResponse: HMAPIResponse) {
+ required init(apiResponse: HMAPIResponse) {
super.init(apiResponse: apiResponse, commandList:
[
HMMemberShipCommand(apiResponse: apiResponse),
import Cocoa
class HMMidnightBattleCommand: HMCompositCommand {
- override init(apiResponse: HMAPIResponse) {
+ required init(apiResponse: HMAPIResponse) {
super.init(apiResponse: apiResponse, commandList:
[
HMCalculateDamageCommand(apiResponse: apiResponse),
import Cocoa
class HMPortCommand: HMCompositCommand {
- override init(apiResponse: HMAPIResponse) {
+ required init(apiResponse: HMAPIResponse) {
super.init(apiResponse: apiResponse, commandList:
[
HMMemberShipCommand(apiResponse: apiResponse),
import Cocoa
class HMPowerUpCommand: HMCompositCommand {
- override init(apiResponse: HMAPIResponse) {
+ required init(apiResponse: HMAPIResponse) {
super.init(apiResponse: apiResponse, commandList:
[
HMMemberShipCommand(apiResponse: apiResponse),
import Cocoa
class HMRemodelSlotCommand: HMCompositCommand {
- override init(apiResponse: HMAPIResponse) {
+ required init(apiResponse: HMAPIResponse) {
super.init(apiResponse: apiResponse, commandList:
[
HMMemberMaterialCommand(apiResponse: apiResponse),
import Cocoa
class HMShipDeckCommand: HMCompositCommand {
- override init(apiResponse: HMAPIResponse) {
+ required init(apiResponse: HMAPIResponse) {
super.init(apiResponse: apiResponse, commandList:
[
HMMemberShipCommand(apiResponse: apiResponse),
import Cocoa
class HMSlotDepriveCommand: HMCompositCommand {
- override init(apiResponse: HMAPIResponse) {
+ required init(apiResponse: HMAPIResponse) {
super.init(apiResponse: apiResponse, commandList:
[
HMMemberShipCommand(apiResponse: apiResponse),
import Cocoa
class HMStart2Command: HMCompositCommand {
- override init(apiResponse: HMAPIResponse) {
+ required init(apiResponse: HMAPIResponse) {
super.init(apiResponse: apiResponse, commandList:
[
HMMasterMapAreaCommand(apiResponse: apiResponse),
// Command
#import "HMJSONCommand.h"
-#import "HMCompositCommand.h"
// Core Data