F47C3EA81E5F06E700D97449 /* MasterSlotItemEquipTypeMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = F47C3EA71E5F06E700D97449 /* MasterSlotItemEquipTypeMapper.swift */; };
F47C3EAA1E5F085B00D97449 /* MasterMissionMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = F47C3EA91E5F085B00D97449 /* MasterMissionMapper.swift */; };
F47C3EAC1E5F1AD900D97449 /* ShipMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = F47C3EAB1E5F1AD900D97449 /* ShipMapper.swift */; };
+ F47C3EAE1E5F26E900D97449 /* DeckMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = F47C3EAD1E5F26E900D97449 /* DeckMapper.swift */; };
F490977B1E19C3910085A45D /* HMSuppliesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F490977A1E19C3910085A45D /* HMSuppliesView.swift */; };
F490977D1E19DF390085A45D /* HMSlotItemFrameView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F490977C1E19DF390085A45D /* HMSlotItemFrameView.swift */; };
F490977F1E19ED400085A45D /* HMStrengthenListItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F490977E1E19ED400085A45D /* HMStrengthenListItemView.swift */; };
F47C3EA71E5F06E700D97449 /* MasterSlotItemEquipTypeMapper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MasterSlotItemEquipTypeMapper.swift; sourceTree = "<group>"; };
F47C3EA91E5F085B00D97449 /* MasterMissionMapper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MasterMissionMapper.swift; sourceTree = "<group>"; };
F47C3EAB1E5F1AD900D97449 /* ShipMapper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShipMapper.swift; sourceTree = "<group>"; };
+ F47C3EAD1E5F26E900D97449 /* DeckMapper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeckMapper.swift; sourceTree = "<group>"; };
F490977A1E19C3910085A45D /* HMSuppliesView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMSuppliesView.swift; sourceTree = "<group>"; };
F490977C1E19DF390085A45D /* HMSlotItemFrameView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMSlotItemFrameView.swift; sourceTree = "<group>"; };
F490977E1E19ED400085A45D /* HMStrengthenListItemView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMStrengthenListItemView.swift; sourceTree = "<group>"; };
F47C3EA71E5F06E700D97449 /* MasterSlotItemEquipTypeMapper.swift */,
F47C3EA91E5F085B00D97449 /* MasterMissionMapper.swift */,
F47C3EAB1E5F1AD900D97449 /* ShipMapper.swift */,
+ F47C3EAD1E5F26E900D97449 /* DeckMapper.swift */,
F4A0D7161E2FB7E000224DCE /* HMCompositCommand.swift */,
F44BC6D01E224299004644E3 /* HMPortCommand.swift */,
F44BC6CA1E223208004644E3 /* HMIgnoreCommand.swift */,
F49097831E19F7760085A45D /* HMStrengthenListItemCellView.swift in Sources */,
F495462E1B1894DD00E0D8D0 /* Bookmark.xcdatamodeld in Sources */,
F44BC7091E279C41004644E3 /* HMKenzoMarkCommand.swift in Sources */,
+ F47C3EAE1E5F26E900D97449 /* DeckMapper.swift in Sources */,
F4048AA11E1951BB008ACFD6 /* HMSuppliesCell.swift in Sources */,
F490977D1E19DF390085A45D /* HMSlotItemFrameView.swift in Sources */,
F4E471291E46ECF1009B5AF4 /* CoreDataCore.swift in Sources */,
--- /dev/null
+//
+// DeckMapper.swift
+// KCD
+//
+// Created by Hori,Masaki on 2017/02/23.
+// Copyright © 2017年 Hori,Masaki. All rights reserved.
+//
+
+import Cocoa
+
+fileprivate enum DeckAPI: String {
+ case getMemberDeck = "/kcsapi/api_get_member/deck"
+ case port = "/kcsapi/api_port/port"
+ case getMemberShip2 = "/kcsapi/api_get_member/ship2"
+ case getMemberShip3 = "/kcsapi/api_get_member/ship3"
+ case getMemberShipDeck = "/kcsapi/api_get_member/ship_deck"
+ case getMemberDeckPort = "/kcsapi/api_get_member/deck_port"
+ case henseiPresetSelect = "/kcsapi/api_req_hensei/preset_select"
+ case kaisouPowerUp = "/kcsapi/api_req_kaisou/powerup"
+}
+
+fileprivate func dataKey(_ apiResponse: HMAPIResponse) -> String {
+ guard let deckApi = DeckAPI(rawValue: apiResponse.api)
+ else { return "api_data" }
+ switch deckApi {
+ case .port: return "api_data.api_deck_port"
+ case .getMemberShip2: return "api_data_deck"
+ case .getMemberShip3: return "api_data.api_deck_data"
+ case .getMemberShipDeck: return "api_data.api_deck_data"
+ case .kaisouPowerUp: return "api_data.api_deck"
+ default: return "api_data"
+ }
+}
+
+class DeckMapper: JSONMapper {
+ required init(_ apiResponse: HMAPIResponse) {
+ self.apiResponse = apiResponse
+ self.configuration = MappingConfiguration(entityName: "Deck",
+ dataKey: dataKey(apiResponse),
+ editorStore: HMServerDataStore.oneTimeEditor())
+ }
+
+ let apiResponse: HMAPIResponse
+ let configuration: MappingConfiguration
+}