2 // ApplySuppliesCommand.swift
5 // Created by Hori,Masaki on 2017/01/08.
6 // Copyright © 2017年 Hori,Masaki. All rights reserved.
11 class ApplySuppliesCommand: JSONCommand {
12 override func execute() {
13 let store = ServerDataStore.oneTimeEditor()
15 .forEach { (_, json) in
16 guard let i = json["api_id"].int,
17 let ship = store.ship(byId: i),
18 let bull = json["api_bull"].int,
19 let fuel = json["api_fuel"].int,
20 let slots = json["api_onslot"].arrayObject as? [Int],
25 ship.onslot_0 = slots[0]
26 ship.onslot_1 = slots[1]
27 ship.onslot_2 = slots[2]
28 ship.onslot_3 = slots[3]
29 ship.onslot_4 = slots[4]