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)