C# Class OpenMetaverse.Inventory

Responsible for maintaining inventory structure. Inventory constructs nodes and manages node children as is necessary to maintain a coherant hirarchy. Other classes should not manipulate or create InventoryNodes explicitly. When A node's parent changes (when a folder is moved, for example) simply pass Inventory the updated InventoryFolder and it will make the appropriate changes to its internal representation.
Mostrar archivo Open project: 3di/3di-viewer-rei-libs Class Usage Examples

Public Methods

Method Description
Contains ( InventoryBase obj ) : bool
Contains ( UUID uuid ) : bool

Used to find out if Inventory contains the InventoryObject specified by uuid.

GetContents ( InventoryFolder folder ) : List
GetContents ( UUID folder ) : List

Returns the contents of the specified folder

GetNodeFor ( UUID uuid ) : InventoryNode
Inventory ( GridClient client, InventoryManager manager ) : System
Inventory ( GridClient client, InventoryManager manager, UUID owner ) : System
RemoveNodeFor ( InventoryBase item ) : void

Removes the InventoryObject and all related node data from Inventory.

UpdateNodeFor ( InventoryBase item ) : void

Updates the state of the InventoryNode and inventory data structure that is responsible for the InventoryObject. If the item was previously not added to inventory, it adds the item, and updates structure accordingly. If it was, it updates the InventoryNode, changing the parent node if item.parentUUID does not match node.Parent.Data.UUID. You can not set the inventory root folder using this method

this ( UUID uuid ) : InventoryBase

By using the bracket operator on this class, the program can get the InventoryObject designated by the specified uuid. If the value for the corresponding UUID is null, the call is equivelant to a call to RemoveNodeFor(this[uuid]). If the value is non-null, it is equivelant to a call to UpdateNodeFor(value), the uuid parameter is ignored.

Protected Methods

Method Description
FireOnInventoryObjectAdded ( InventoryBase obj ) : void
FireOnInventoryObjectRemoved ( InventoryBase obj ) : void
FireOnInventoryObjectUpdated ( InventoryBase oldObject, InventoryBase newObject ) : void

Method Details

Contains() public method

public Contains ( InventoryBase obj ) : bool
obj InventoryBase
return bool

Contains() public method

Used to find out if Inventory contains the InventoryObject specified by uuid.
public Contains ( UUID uuid ) : bool
uuid UUID The UUID to check.
return bool

FireOnInventoryObjectAdded() protected method

protected FireOnInventoryObjectAdded ( InventoryBase obj ) : void
obj InventoryBase
return void

FireOnInventoryObjectRemoved() protected method

protected FireOnInventoryObjectRemoved ( InventoryBase obj ) : void
obj InventoryBase
return void

FireOnInventoryObjectUpdated() protected method

protected FireOnInventoryObjectUpdated ( InventoryBase oldObject, InventoryBase newObject ) : void
oldObject InventoryBase
newObject InventoryBase
return void

GetContents() public method

public GetContents ( InventoryFolder folder ) : List
folder InventoryFolder
return List

GetContents() public method

Returns the contents of the specified folder
When folder does not exist in the inventory
public GetContents ( UUID folder ) : List
folder UUID A folder's UUID
return List

GetNodeFor() public method

public GetNodeFor ( UUID uuid ) : InventoryNode
uuid UUID
return InventoryNode

Inventory() public method

public Inventory ( GridClient client, InventoryManager manager ) : System
client GridClient
manager InventoryManager
return System

Inventory() public method

public Inventory ( GridClient client, InventoryManager manager, UUID owner ) : System
client GridClient
manager InventoryManager
owner UUID
return System

RemoveNodeFor() public method

Removes the InventoryObject and all related node data from Inventory.
public RemoveNodeFor ( InventoryBase item ) : void
item InventoryBase The InventoryObject to remove.
return void

UpdateNodeFor() public method

Updates the state of the InventoryNode and inventory data structure that is responsible for the InventoryObject. If the item was previously not added to inventory, it adds the item, and updates structure accordingly. If it was, it updates the InventoryNode, changing the parent node if item.parentUUID does not match node.Parent.Data.UUID. You can not set the inventory root folder using this method
public UpdateNodeFor ( InventoryBase item ) : void
item InventoryBase The InventoryObject to store
return void

this() public method

By using the bracket operator on this class, the program can get the InventoryObject designated by the specified uuid. If the value for the corresponding UUID is null, the call is equivelant to a call to RemoveNodeFor(this[uuid]). If the value is non-null, it is equivelant to a call to UpdateNodeFor(value), the uuid parameter is ignored.
public this ( UUID uuid ) : InventoryBase
uuid UUID The UUID of the InventoryObject to get or set, ignored if set to non-null value.
return InventoryBase