mdx-m3-viewer
Version:
A browser WebGL model viewer. Mainly focused on models of the games Warcraft 3 and Starcraft 2.
30 lines (25 loc) • 751 B
text/typescript
import BinaryStream from '../../../common/binarystream';
/**
* A map title.
*/
export default class MapTitle {
visible: number = 0;
chapterTitle: string = '';
mapTitle: string = '';
path: string = '';
load(stream: BinaryStream) {
this.visible = stream.readInt32();
this.chapterTitle = stream.readUntilNull();
this.mapTitle = stream.readUntilNull();
this.path = stream.readUntilNull();
}
save(stream: BinaryStream) {
stream.writeInt32(this.visible);
stream.write(`${this.chapterTitle}\0`);
stream.write(`${this.mapTitle}\0`);
stream.write(`${this.path}\0`);
}
getByteLength() {
return 7 + this.chapterTitle.length + this.mapTitle.length + this.path.length;
}
}