From 6f6a7958e27e8745a21e698e3505b7ba03af32a1 Mon Sep 17 00:00:00 2001 From: Dan Crosby Date: Sun, 23 Sep 2018 12:32:03 -0700 Subject: [PATCH] Convert to castle as modifier --- MapTerrainConverter/main.swift | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/MapTerrainConverter/main.swift b/MapTerrainConverter/main.swift index c5d9b9fdb5..dce7305bdc 100644 --- a/MapTerrainConverter/main.swift +++ b/MapTerrainConverter/main.swift @@ -8,23 +8,23 @@ import Foundation -struct GameFile : Codable { - public let hexMap : HexMap +struct OldGameFile : Codable { + public let hexMap : OldHexMap } struct NewGameFile : Codable { - public let hexMap : NewHexMap + public let hexMap : HexMap } let deserializer = CroissantDeserializer() -let fileUrl = URL(fileURLWithPath: "/Users/dancrosby/CodingProjects/github/eagle0/server/installdata/usr/local/share/eagle0/startfiles/bigfightWithRiver.e0g") +let fileUrl = URL(fileURLWithPath: "/Users/dancrosby/CodingProjects/github/eagle0/server/installdata/usr/local/share/eagle0/startfiles/narrowWithRiver.e0g") let data = try! Data(contentsOf: fileUrl) -let gameFile = CroissantDeserializer.deserialize(GameFile.self, from: data)! -let oldMap = gameFile.hexMap -let newGameFile = NewGameFile(hexMap: NewHexMap(oldMap: oldMap)) +let oldGameFile = CroissantDeserializer.deserialize(OldGameFile.self, from: data)! +let oldMap = oldGameFile.hexMap +let newGameFile = NewGameFile(hexMap: HexMap(oldMap: oldMap)) let newData = newGameFile.croissantEncodedData! -let newUrl = URL(fileURLWithPath: "/Users/dancrosby/CodingProjects/github/eagle0/server/installdata/usr/local/share/eagle0/startfiles/bigfightWithRiver.e0g_") +let newUrl = URL(fileURLWithPath: "/Users/dancrosby/CodingProjects/github/eagle0/server/installdata/usr/local/share/eagle0/startfiles/narrowWithRiver.e0g_") try! newData.write(to: newUrl)