Convert to castle as modifier

This commit is contained in:
2018-09-23 12:32:03 -07:00
parent 5a7428d896
commit 6f6a7958e2
+8 -8
View File
@@ -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)