Empeld
Empeld plugin documentation.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events
pluginbase.Objects.Syncable.SyncableBase< T > Class Template Referenceabstract

The base class for any syncable More...

Inheritance diagram for pluginbase.Objects.Syncable.SyncableBase< T >:
pluginbase.Objects.Syncable.INetSyncable pluginbase.Objects.Syncable.INetWatcher pluginbase.Objects.Syncable.SyncableObject pluginbase.Objects.Syncable.ValidatedSyncableBase< T, TBase > pluginbase.Objects.Syncable.Watchers.ArraySync< T > pluginbase.Objects.Syncable.Watchers.ListSync< T > pluginbase.Objects.Syncable.Watchers.MutableSync< T > essentials.action.ItemFramework.Containers.InventorySync essentials.action.ItemFramework.ItemBase pluginbase.Objects.Syncable.Entity.EntityBase pluginbase.Objects.Syncable.Watchers.SyncBase< T > essentials.action.ItemFramework.Containers.SelectableInventorySync essentials.action.ItemFramework.BlockItem essentials.action.ItemFramework.Interactive.Bases.UseableItemBase essentials.action.ItemFramework.ItemBundle essentials.action.Entities.Actor.ActorBase essentials.action.ItemFramework.World.ItemDropEntity essentials.BlockEntities.BlockEntityBase< TBlock > essentials.Systems.Structures.Structure pluginbase.Objects.Syncable.Entity.Static.StaticEntityBase pluginbase.Objects.Syncable.Watchers.SmoothSync< T > pluginbase.Objects.Syncable.Watchers.Sync< T >

Protected Member Functions

void Touch ()
 Touch the instance, notifying something has changed More...
 
virtual void TouchRecurse ()
 Touch the instance More...
 
virtual void ResetWatch ()
 Reset the touched state More...
 
virtual void OnChanged ()
 Raises the changed event. More...
 
abstract void EncodeTo (BinaryWriter writer, EncodeContext context)
 Encode changes to binary data More...
 
abstract void DecodeFrom (BinaryReader reader, DecodeContext context)
 Decode changes from binary data More...
 
abstract void Persist (IPersistObject obj)
 Persist the instance to a persist object More...
 
abstract void Load (IReadPersistObject obj)
 Load the instance from a persist object More...
 

Events

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...
 

Additional Inherited Members

- 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...
 

Detailed Description

The base class for any syncable

Type Constraints
T :SyncableBase<T> 

Member Function Documentation

abstract void pluginbase.Objects.Syncable.SyncableBase< T >.DecodeFrom ( BinaryReader  reader,
DecodeContext  context 
)
protectedpure virtual
abstract void pluginbase.Objects.Syncable.SyncableBase< T >.EncodeTo ( BinaryWriter  writer,
EncodeContext  context 
)
protectedpure virtual
abstract void pluginbase.Objects.Syncable.SyncableBase< T >.Load ( IReadPersistObject  obj)
protectedpure virtual
virtual void pluginbase.Objects.Syncable.SyncableBase< T >.OnChanged ( )
protectedvirtual

Raises the changed event.

130  {
131  if (Changed != null)
132  {
133  Changed((T)this);
134  }
135  }
Action< T > Changed
Event triggered when any change occurs on this object, either locally or over the network ...
Definition: SyncableBase.cs:23
abstract void pluginbase.Objects.Syncable.SyncableBase< T >.Persist ( IPersistObject  obj)
protectedpure virtual
virtual void pluginbase.Objects.Syncable.SyncableBase< T >.ResetWatch ( )
protectedvirtual
void pluginbase.Objects.Syncable.SyncableBase< T >.Touch ( )
protected

Touch the instance, notifying something has changed

Implements pluginbase.Objects.Syncable.INetWatcher.

66  {
67  //If we're already touched, no need to touch again, as the touch-chain
68  //could be long, and unnecessary
69  if (!_modified)
70  {
71  _modified = true;
72  if (_watcher != null)
73  _watcher.Touch();
74  OnTouched();
75  }
76  OnChanged();
77  }
virtual void OnChanged()
Raises the changed event.
Definition: SyncableBase.cs:129
void Touch()
Touch the class, signalling that a change ocurred
virtual void pluginbase.Objects.Syncable.SyncableBase< T >.TouchRecurse ( )
protectedvirtual

Touch the instance

Implements pluginbase.Objects.Syncable.INetWatcher.

Reimplemented in pluginbase.Objects.Syncable.Watchers.ListSync< T >, pluginbase.Objects.Syncable.SyncableObject, and pluginbase.Objects.Syncable.Watchers.MutableSync< T >.

88  {
89  this.Touch();
90  }
void Touch()
Touch the instance, notifying something has changed
Definition: SyncableBase.cs:65

Event Documentation

Action<T> pluginbase.Objects.Syncable.SyncableBase< T >.Changed

Event triggered when any change occurs on this object, either locally or over the network

Action<T> pluginbase.Objects.Syncable.SyncableBase< T >.NetUpdate

Event triggered when a change occurs resulting from a change over the network

Action<T> pluginbase.Objects.Syncable.SyncableBase< T >.Touched

Event occurs only when an object is first touched. Usually the first instance of a local-change


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