OSDN Git Service

Doutakuを導入
[kcd/KCD.git] / KCD / BattleCommand.swift
1 //
2 //  BattleCommand.swift
3 //  KCD
4 //
5 //  Created by Hori,Masaki on 2017/01/18.
6 //  Copyright © 2017年 Hori,Masaki. All rights reserved.
7 //
8
9 import Cocoa
10
11 final class BattleCommand: JSONCommand {
12     
13     override class func canExecuteAPI(_ api: API) -> Bool {
14         
15         return api.type == .battle || api.type == .battleResult
16     }
17     
18     override func execute() {
19         
20         CalculateDamageCommand(apiResponse: apiResponse).execute()
21         
22         switch apiResponse.api.endpoint {
23             
24         case .battleResult, .combinedBattleResult:
25             DropShipHistoryCommand(apiResponse: apiResponse).execute()
26             DummyShipCommand(apiResponse: apiResponse).execute()
27             GuardShelterCommand(apiResponse: apiResponse).execute()
28             
29         default: break
30         }
31     }
32 }