Example #1
0
        public virtual IAutoSaveAndLoad CloneObject()
        {
            IAutoSaveAndLoad result = (IAutoSaveAndLoad)System.Activator.CreateInstance(this.GetType());

            var desc = IAutoSLClassDescManager.Instance.GetClassDesc(this.GetType());

            foreach (IAutoSLField f in desc.Fields)
            {
                var i = f.Property;

                System.Type type = i.PropertyType;
                i.SetValue(result, i.GetValue(this, null), null);
            }
            return(result);
        }
Example #2
0
 public void Write(IAutoSaveAndLoad data)
 {
     data.PackageWrite(this);
 }
Example #3
0
        //void DeepCopy(byte[] addr)
        //{
        //    mHandle = new byte[addr.Length + 4];
        //    Buffer.BlockCopy(addr, 0, mHandle, 0, addr.Length);
        //    mPos = 0;
        //    mIsDeepCopy = true;
        //}

        #region Data Reader
        public void Read(IAutoSaveAndLoad result, bool bToClient)
        {
            result.DataRead(this, bToClient);
        }
Example #4
0
 public void Read(IAutoSaveAndLoad data)
 {
     data.PackageRead(this);
 }
Example #5
0
 public void Write(IAutoSaveAndLoad data, bool bToClient)
 {
     data.DataWrite(this, bToClient);
 }