public SyncedProperty(SyncedObject syncedObject, Int32 propertyId) { m_SyncedObject = syncedObject; m_PropertyId = propertyId; syncedObject.AddProperty(this); }
public void RemoveObject(SyncedObject syncedObject) { for (LinkedListNode <HostedObject> node = m_HostedObjects.First; node != null; node = node.Next) { if (node.Value.Object == syncedObject) { m_HostedObjects.Remove(node); break; } } }
public void AddObject(SyncedObject syncedObject) { Int32 lastValue = -1; LinkedListNode <HostedObject> node; for (node = m_HostedObjects.First; node != null; node = node.Next) { Int32 curValue = node.Value.Id; if (2 <= curValue - lastValue) { break; } lastValue = curValue; } Int32 newValue = lastValue + 1; if (null != node) { m_HostedObjects.AddBefore(node, new HostedObject(newValue, syncedObject) ); } else { m_HostedObjects.AddLast( new HostedObject(newValue, syncedObject) ); } syncedObject.ObjectId = newValue; if (null != m_Syncer) { syncedObject.ConnectSyncer(m_Syncer); } }
public void AddObject(SyncedObject syncedObject) { Int32 lastValue = -1; LinkedListNode<HostedObject> node; for (node = m_HostedObjects.First; node != null; node = node.Next) { Int32 curValue = node.Value.Id; if (2 <= curValue - lastValue) { break; } lastValue = curValue; } Int32 newValue = lastValue + 1; if (null != node) { m_HostedObjects.AddBefore(node, new HostedObject(newValue, syncedObject) ); } else { m_HostedObjects.AddLast( new HostedObject(newValue, syncedObject) ); } syncedObject.ObjectId = newValue; if(null != m_Syncer) syncedObject.ConnectSyncer(m_Syncer); }
public SyncedInt32(SyncedObject syncedObject, Int32 propertyId) : base(syncedObject, propertyId) { }
public SyncedBoolean(SyncedObject syncedObject, Int32 propertyId) : base(syncedObject, propertyId) { }
public HostedObject(Int32 id, SyncedObject obj) { Id = id; Object = obj; }
public void RemoveObject(SyncedObject syncedObject) { for (LinkedListNode<HostedObject> node = m_HostedObjects.First; node != null; node = node.Next) { if (node.Value.Object == syncedObject) { m_HostedObjects.Remove(node); break; } } }