UNPKG

mdx-m3-viewer

Version:

A browser WebGL model viewer. Mainly focused on models of the games Warcraft 3 and Starcraft 2.

20 lines (16 loc) 391 B
import BinaryStream from '../../../common/binarystream'; /** * A random unit. */ export default class RandomUnit { id: string = '\0\0\0\0'; chance: number = 0; load(stream: BinaryStream) { this.id = stream.read(4); this.chance = stream.readInt32(); } save(stream: BinaryStream) { stream.write(this.id); stream.writeInt32(this.chance); } }