sc4
Version:
A command line utility for automating SimCity 4 modding tasks & modifying savegames
29 lines (28 loc) • 828 B
JavaScript
import FileType from './file-types.js';
import { kFileType } from './symbols.js';
import WriteBuffer from './write-buffer.js';
export default class ParkManager {
static [kFileType] = FileType.ParkManager;
crc = 0x00000000;
mem = 0x00000000;
version = '2';
buildings = [];
buildings2 = [];
parse(rs) {
rs.size();
this.crc = rs.dword();
this.mem = rs.dword();
this.version = rs.version(1);
this.buildings = rs.array(() => rs.pointer());
this.buildings2 = rs.array(() => rs.pointer());
rs.assert();
}
toBuffer() {
let ws = new WriteBuffer();
ws.dword(this.mem);
ws.version(this.version);
ws.array(this.buildings, ws.pointer);
ws.array(this.buildings2, ws.pointer);
return ws.seal();
}
}