OSDN Git Service

MasterSlotItemMapperを作成
authormasakih <masakih@users.sourceforge.jp>
Thu, 23 Feb 2017 12:02:12 +0000 (21:02 +0900)
committermasakih <masakih@users.sourceforge.jp>
Thu, 23 Feb 2017 12:02:12 +0000 (21:02 +0900)
KCD.xcodeproj/project.pbxproj
KCD/HMMasterSlotItemCommand.swift
KCD/MasterSlotItemMapper.swift [new file with mode: 0644]

index 96d3a9b..03c2f9f 100644 (file)
                F47C3EA01E5DE08F00D97449 /* MasterMapInfoMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = F47C3E9F1E5DE08F00D97449 /* MasterMapInfoMapper.swift */; };
                F47C3EA21E5EFCC800D97449 /* MasterUseItemMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = F47C3EA11E5EFCC800D97449 /* MasterUseItemMapper.swift */; };
                F47C3EA41E5F017500D97449 /* MasterFurnitureMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = F47C3EA31E5F017500D97449 /* MasterFurnitureMapper.swift */; };
+               F47C3EA61E5F050D00D97449 /* MasterSlotItemMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = F47C3EA51E5F050D00D97449 /* MasterSlotItemMapper.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 */; };
                F47C3E9F1E5DE08F00D97449 /* MasterMapInfoMapper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MasterMapInfoMapper.swift; sourceTree = "<group>"; };
                F47C3EA11E5EFCC800D97449 /* MasterUseItemMapper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MasterUseItemMapper.swift; sourceTree = "<group>"; };
                F47C3EA31E5F017500D97449 /* MasterFurnitureMapper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MasterFurnitureMapper.swift; sourceTree = "<group>"; };
+               F47C3EA51E5F050D00D97449 /* MasterSlotItemMapper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MasterSlotItemMapper.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>"; };
                                F47C3E9D1E5DD3E400D97449 /* MasterMapAreaMapper.swift */,
                                F47C3E9F1E5DE08F00D97449 /* MasterMapInfoMapper.swift */,
                                F47C3EA11E5EFCC800D97449 /* MasterUseItemMapper.swift */,
+                               F47C3EA51E5F050D00D97449 /* MasterSlotItemMapper.swift */,
                                F4A0D7161E2FB7E000224DCE /* HMCompositCommand.swift */,
                                F44BC6D01E224299004644E3 /* HMPortCommand.swift */,
                                F44BC6CA1E223208004644E3 /* HMIgnoreCommand.swift */,
                                F44BC6F31E23D32B004644E3 /* HMRealPowerUpCommand.swift in Sources */,
                                F4E5FF021E150A850026868C /* HMAncherageRepairTimerViewController.swift in Sources */,
                                F4AA59521E1E607F001667AF /* HMJSONViewWindowController.swift in Sources */,
+                               F47C3EA61E5F050D00D97449 /* MasterSlotItemMapper.swift in Sources */,
                                F47215AA1E1F96B60083D3BC /* HMResourceHistoryDataStore.swift in Sources */,
                                F47C3EA41E5F017500D97449 /* MasterFurnitureMapper.swift in Sources */,
                                F45FBB6F1E0FDB33000E72B9 /* HMStrengthenListViewController.swift in Sources */,
index 8eb462e..9bc4c3a 100644 (file)
@@ -14,6 +14,7 @@ class HMMasterSlotItemCommand: HMJSONCommand {
     }
     
     override func execute() {
-        commitJSON(toEntityNamed: "MasterSlotItem")
+//        commitJSON(toEntityNamed: "MasterSlotItem")
+        MasterSlotItemMapper(apiResponse).commit()
     }
 }
diff --git a/KCD/MasterSlotItemMapper.swift b/KCD/MasterSlotItemMapper.swift
new file mode 100644 (file)
index 0000000..7e6147a
--- /dev/null
@@ -0,0 +1,22 @@
+//
+//  MasterSlotItemMapper.swift
+//  KCD
+//
+//  Created by Hori,Masaki on 2017/02/23.
+//  Copyright © 2017年 Hori,Masaki. All rights reserved.
+//
+
+import Cocoa
+
+class MasterSlotItemMapper: JSONMapper {
+    required init(_ apiResponse: HMAPIResponse) {
+        self.apiResponse = apiResponse
+    }
+    
+    let apiResponse: HMAPIResponse
+    let configuration: MappingConfiguration = {
+        return MappingConfiguration(entityName: "MasterSlotItem",
+                                    dataKey: "api_data.api_mst_slotitem",
+                                    editorStore: HMServerDataStore.oneTimeEditor())
+    }()
+}