mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-28 21:15:45 +00:00
Convert to castle as modifier
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user