Extensive work on building, wearables, assets, inventory, attachments, serialization, etc.

Resolves #36
This commit is contained in:
Casper Warden
2020-11-19 16:51:14 +00:00
parent 7b41239a39
commit 2ff00a30f8
58 changed files with 6659 additions and 2228 deletions

View File

@@ -91,6 +91,10 @@ export class UUID
+ hexString.substr(16, 4) + '-'
+ hexString.substr(20, 12));
}
else if (typeof buf === 'object' && buf.toString !== undefined)
{
this.setUUID(buf.toString());
}
else
{
console.error('Can\'t accept UUIDs of type ' + typeof buf);
@@ -125,6 +129,11 @@ export class UUID
binary.copy(buf, pos, 0);
}
public isZero(): boolean
{
return (this.mUUID === '00000000-0000-0000-0000-000000000000');
}
public equals(cmp: UUID | string): boolean
{
if (typeof cmp === 'string')
@@ -133,6 +142,10 @@ export class UUID
}
else
{
if (cmp.equals === undefined)
{
throw new Error(cmp.constructor.name + ' is not a UUID');
}
return cmp.equals(this.mUUID);
}
}