UNPKG

sc4

Version:

A command line utility for automating SimCity 4 modding tasks & modifying savegames

28 lines (27 loc) 720 B
// # cste-terrain.ts import WriteBuffer from './write-buffer.js'; import { kFileType } from './symbols.js'; import FileType from './file-types.js'; // # cSTETerrain export default class cSTETerrain { static [kFileType] = FileType.cSTETerrain; crc = 0x00000000; mem = 0x00000000; version = 0x0002; terrainView = null; parse(rs) { rs.size(); this.crc = rs.dword(); this.mem = rs.dword(); this.version = rs.word(); this.terrainView = rs.pointer(); rs.assert(); } toBuffer() { let ws = new WriteBuffer(); ws.dword(this.mem); ws.word(this.version); ws.pointer(this.terrainView); return ws.seal(); } }