public static NetRoot <T> Connect(BinaryReader reader) { NetRoot <T> netRoot = new NetRoot <T>(); netRoot.ReadConnectionPacket(reader); return(netRoot); }
public void Add(TKey key, TValue value) { NetRoot <TValue> root = new NetRoot <TValue>(value); root.Serializer = Serializer; Roots.Add(key, root); }
public void CloneInto(NetRef <T> netref) { NetRoot <T> netRoot = Clone(); T copy = netRoot.Value; netRoot.Value = null; netref.Value = copy; }
public virtual NetRoot <T> Clone() { using (MemoryStream stream = new MemoryStream()) { using (BinaryWriter writer = new BinaryWriter(stream)) { using (BinaryReader reader = new BinaryReader(stream)) { WriteFull(writer); stream.Seek(0L, SeekOrigin.Begin); NetRoot <T> netRoot = new NetRoot <T>(); netRoot.Serializer = Serializer; netRoot.ReadFull(reader, Clock.netVersion); netRoot.reassigned.Set(default(NetVersion)); netRoot.MarkClean(); return(netRoot); } } } }