OSDN Git Service

guard の書き方を統一した
[kcd/KCD.git] / KCD / RealDestroyShipCommand.swift
1 //
2 //  RealDestroyShipCommand.swift
3 //  KCD
4 //
5 //  Created by Hori,Masaki on 2017/01/09.
6 //  Copyright © 2017年 Hori,Masaki. All rights reserved.
7 //
8
9 import Cocoa
10
11 final class RealDestroyShipCommand: JSONCommand {
12     
13     override func execute() {
14         
15         let store = ServerDataStore.oneTimeEditor()
16         
17         parameter["api_ship_id"]
18             .int
19             .flatMap { store.ship(by: $0) }
20             .flatMap { store.delete($0) }
21     }
22 }