- Remove ExtraParams, TextureAnim, ParticleSystem binary data from GameObjects, instead encode on the fly when needed - Add XML object decoding (WIP) - Move FlexibleData, LightDate, LightImageData, MeshData, SculptData inside ExtraParams class -
27 lines
704 B
TypeScript
27 lines
704 B
TypeScript
import {UUID} from '../UUID';
|
|
import {SculptType} from '../..';
|
|
|
|
export class SculptData
|
|
{
|
|
texture: UUID = UUID.zero();
|
|
type: SculptType = SculptType.None;
|
|
|
|
constructor(buf?: Buffer, pos?: number, length?: number)
|
|
{
|
|
if (buf !== undefined && pos !== undefined && length !== undefined)
|
|
{
|
|
if (length >= 17)
|
|
{
|
|
this.texture = new UUID(buf, pos);
|
|
pos += 16;
|
|
this.type = buf.readUInt8(pos);
|
|
}
|
|
}
|
|
}
|
|
writeToBuffer(buf: Buffer, pos: number)
|
|
{
|
|
this.texture.writeToBuffer(buf, pos); pos = pos + 16;
|
|
buf.writeUInt8(this.type, pos);
|
|
}
|
|
}
|