2 // NyukyoStartCommand.swift
5 // Created by Hori,Masaki on 2017/01/08.
6 // Copyright © 2017年 Hori,Masaki. All rights reserved.
11 class NyukyoStartCommand: JSONCommand {
12 override class func canExecuteAPI(_ api: String) -> Bool {
13 if api == "/kcsapi/api_req_nyukyo/start" { return true }
16 override func execute() {
17 guard let hi = parameter["api_highspeed"].int,
21 let store = ServerDataStore.oneTimeEditor()
22 parameter["api_ship_id"]
24 .flatMap { store.ship(byId: $0) }
25 .map { $0.nowhp = $0.maxhp }
28 .map { $0.kousokushuhuku = $0.kousokushuhuku - 1 }