Empeld
Empeld plugin documentation.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events
essentials.action.ItemFramework.Containers.InventorySync Class Reference

Class designed to synchronize IItem types More...

Inheritance diagram for essentials.action.ItemFramework.Containers.InventorySync:
pluginbase.Objects.Syncable.SyncableObject essentials.action.ItemFramework.Containers.IInventory pluginbase.Objects.Syncable.SyncableBase< T > pluginbase.Objects.Syncable.INetSyncable pluginbase.Objects.Syncable.INetWatcher essentials.action.ItemFramework.Containers.SelectableInventorySync

Public Member Functions

 InventorySync ()
 
 InventorySync (int size)
 
- Public Member Functions inherited from pluginbase.Objects.Syncable.SyncableObject
 SyncableObject ()
 Initializes a new instance of the pluginbase.Objects.Syncable.SyncableObject class. More...
 
- Public Member Functions inherited from essentials.action.ItemFramework.Containers.IInventory
int CountItems ()
 Counts all none-null items More...
 

Protected Member Functions

virtual void OnItemChange (int idx)
 
virtual void OnCapacityChange (int capacity, IItem[] overflow)
 
- Protected Member Functions inherited from pluginbase.Objects.Syncable.SyncableObject
sealed override void ResetWatch ()
 Reset variables watched status More...
 
sealed override void TouchRecurse ()
 Touch self, including all children of this syncable object More...
 
sealed override void EncodeTo (BinaryWriter writer, EncodeContext context)
 Encode changes to binary data More...
 
sealed override void DecodeFrom (BinaryReader reader, DecodeContext context)
 Decode changes from binary data More...
 
sealed override void Persist (IPersistObject obj)
 Build up a persistant object for this syncable, including all sync children and persist objects More...
 
sealed override void Load (IReadPersistObject obj)
 Load a given persistent object back into this instance More...
 
- Protected Member Functions inherited from pluginbase.Objects.Syncable.SyncableBase< T >
void Touch ()
 Touch the instance, notifying something has changed More...
 
virtual void OnChanged ()
 Raises the changed event. More...
 

Properties

int Capacity [get, set]
 
- Properties inherited from pluginbase.Objects.Syncable.SyncableObject
virtual ushort NetOwnerId [get]
 Gets the network owner of this object (user id) More...
 
- Properties inherited from pluginbase.Objects.Syncable.INetSyncable
INetWatcher Watcher [get, set]
 Who is watching (who to inform of a change) More...
 
bool Modified [get]
 Gets a value indicating whether this pluginbase.Objects.Syncable.INetSyncable is modified. More...
 
- Properties inherited from essentials.action.ItemFramework.Containers.IInventory
int Capacity [get, set]
 Gets or sets the capacity. More...
 

Events

ItemEvent ItemChanged
 Occurs when any item changes in the array More...
 
CapacityEvent CapacityChanged
 Occurs when the capacity of the inventory changes More...
 
- Events inherited from pluginbase.Objects.Syncable.SyncableBase< T >
Action< T > Changed
 Event triggered when any change occurs on this object, either locally or over the network More...
 
Action< T > NetUpdate
 Event triggered when a change occurs resulting from a change over the network More...
 
Action< T > Touched
 Event occurs only when an object is first touched. Usually the first instance of a local-change More...
 
- Events inherited from essentials.action.ItemFramework.Containers.IInventory
ItemEvent ItemChanged
 Occurs when item changed in the inventory More...
 
CapacityEvent CapacityChanged
 Occurs when capacity changed. More...
 

Detailed Description

Class designed to synchronize IItem types

Constructor & Destructor Documentation

essentials.action.ItemFramework.Containers.InventorySync.InventorySync ( )
39  {
40  this._items.ItemChanged += HandleItemChanged;
41  this._items.SizeChanged += HandleSizeChanged;
42  this._items.Resize(5);
43  }
essentials.action.ItemFramework.Containers.InventorySync.InventorySync ( int  size)
46  :this()
47  {
48  this._items.Resize(size);
49  }

Member Function Documentation

virtual void essentials.action.ItemFramework.Containers.InventorySync.OnCapacityChange ( int  capacity,
IItem[]  overflow 
)
protectedvirtual
68  {
69  if (this.CapacityChanged != null)
70  this.CapacityChanged(capacity, overflow);
71  }
CapacityEvent CapacityChanged
Occurs when the capacity of the inventory changes
Definition: InventorySync.cs:26
virtual void essentials.action.ItemFramework.Containers.InventorySync.OnItemChange ( int  idx)
protectedvirtual

Attribute: idx

);

Reimplemented in essentials.action.ItemFramework.Containers.SelectableInventorySync.

62  {
63  if (this.ItemChanged != null)
64  this.ItemChanged(idx, this._items[idx]);
65  }
ItemEvent ItemChanged
Occurs when any item changes in the array
Definition: InventorySync.cs:21

Property Documentation

int essentials.action.ItemFramework.Containers.InventorySync.Capacity
getset

Event Documentation

CapacityEvent essentials.action.ItemFramework.Containers.InventorySync.CapacityChanged

Occurs when the capacity of the inventory changes

ItemEvent essentials.action.ItemFramework.Containers.InventorySync.ItemChanged

Occurs when any item changes in the array


The documentation for this class was generated from the following file: