Add ObjectStoreLite to reduce memory footprint if the full object data is not needed
This commit is contained in:
35
lib/classes/GameObjectLite.ts
Normal file
35
lib/classes/GameObjectLite.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import {UUID} from './UUID';
|
||||
import {IGameObject} from './interfaces/IGameObject';
|
||||
import {NameValue} from './NameValue';
|
||||
|
||||
export class GameObjectLite implements IGameObject
|
||||
{
|
||||
ID: number;
|
||||
FullID: UUID;
|
||||
ParentID: number;
|
||||
OwnerID: UUID;
|
||||
IsAttachment: boolean;
|
||||
NameValue: {[key: string]: NameValue};
|
||||
constructor()
|
||||
{
|
||||
this.IsAttachment = false;
|
||||
}
|
||||
|
||||
hasNameValueEntry(key: string): boolean
|
||||
{
|
||||
if (this.NameValue['AttachItemID'])
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
getNameValueEntry(key: string): string
|
||||
{
|
||||
if (this.NameValue['AttachItemID'])
|
||||
{
|
||||
return this.NameValue['AttachItemID'].value;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user