Receive and respond to friend requests and inventory offers
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import {UUID} from './UUID';
|
||||
import {ClientEvents} from './ClientEvents';
|
||||
import {AssetType} from '../enums/AssetType';
|
||||
|
||||
export class Inventory
|
||||
{
|
||||
main: {
|
||||
skeleton: {
|
||||
typeDefault: number,
|
||||
typeDefault: AssetType,
|
||||
version: number,
|
||||
name: string,
|
||||
folderID: UUID,
|
||||
@@ -34,4 +35,24 @@ export class Inventory
|
||||
{
|
||||
this.clientEvents = clientEvents;
|
||||
}
|
||||
findFolderForType(type: AssetType): UUID
|
||||
{
|
||||
if (this.main.root === undefined)
|
||||
{
|
||||
return UUID.zero();
|
||||
}
|
||||
if (type === AssetType.Folder)
|
||||
{
|
||||
return this.main.root;
|
||||
}
|
||||
let found = UUID.zero();
|
||||
this.main.skeleton.forEach((folder) =>
|
||||
{
|
||||
if (folder.typeDefault === type)
|
||||
{
|
||||
found = folder.folderID;
|
||||
}
|
||||
});
|
||||
return found;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user