Empeld
Empeld plugin documentation.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events
pluginbase.Objects.Syncable.ValidatedSyncableBase< T, TBase > Class Template Reference

Base class helper for a syncable than can be validated More...

Inheritance diagram for pluginbase.Objects.Syncable.ValidatedSyncableBase< T, TBase >:
pluginbase.Objects.Syncable.SyncableBase< T > pluginbase.Objects.Syncable.IValidatedNetSyncable pluginbase.Objects.Syncable.INetSyncable pluginbase.Objects.Syncable.INetWatcher pluginbase.Objects.Syncable.Watchers.SyncBase< T > pluginbase.Objects.Syncable.Watchers.SmoothSync< T > pluginbase.Objects.Syncable.Watchers.Sync< T >

Protected Member Functions

bool Validate (T current, T proposed, DecodeContext context)
 Validate the specified current, proposed and context. More...
 
- Protected Member Functions inherited from pluginbase.Objects.Syncable.SyncableBase< T >
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...
 

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

Detailed Description

Base class helper for a syncable than can be validated

Type Constraints
TBase :ValidatedSyncableBase 
TBase :T 
TBase :TBase 

Member Function Documentation

bool pluginbase.Objects.Syncable.ValidatedSyncableBase< T, TBase >.Validate ( current,
proposed,
DecodeContext  context 
)
protected

Validate the specified current, proposed and context.

Parameters
currentIf set to true current.
proposedIf set to true proposed.
contextIf set to true context.

Attribute: i

;

48  {
49  for (int i=0; i<_validators.Count; ++i)
50  {
51  var validator = _validators[i];
52  if (validator.ValidateBy.HasFlag(context.Endpoint)
53  && !validator.Validate(current, proposed, context))
54  {
55  return false;
56  }
57  }
58  return true;
59  }

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