private void WriteDefaults(BinaryWriter writer, SerializedBase obj)
 {
     writer.Write(obj.ID);
     writer.Write(obj.IsNull);
     writer.Write(obj.IsReference);
     writer.Write((int)obj.Mode);
     writer.Write(obj.Type);
 }
        private void AddToComparables(SerializedBase serializable, object value, Type valueType)
        {
            if (!cSerializables.ContainsKey(valueType))
            {
                cSerializables.Add(valueType, new List <CSerializable>());
            }

            cSerializables[valueType].Add(new CSerializable(serializable, value));
        }
Example #3
0
            private SerializedBase DeserializeDefaults(BinaryReader reader)
            {
                var s = new SerializedBase(0, "");

                s.ID          = reader.ReadInt32();
                s.IsNull      = reader.ReadBoolean();
                s.IsReference = reader.ReadBoolean();
                s.Mode        = (ESerializableMode)reader.ReadInt32();
                s.Type        = reader.ReadString();

                return(s);
            }
Example #4
0
        private object Read(SerializedBase item)
        {
            switch (item.Mode)
            {
            case ESerializableMode.Primitive:
                return(ReadPrimitive((SerializedPrimitive)item));

            case ESerializableMode.Enum:
                return(ReadEnum((SerializedEnum)item));

            case ESerializableMode.List:
                return(ReadList((SerializedList)item));

            case ESerializableMode.Class:
                return(ReadClass((SerializedClass)item));

            default:
                return(null);
            }
        }
Example #5
0
 public void Add(string name, SerializedBase value)
 {
     Values.Add(name, value);
 }
Example #6
0
 public SerializedClass(SerializedBase sBase) : base(sBase.ID, sBase.Type)
 {
     IsNull      = sBase.IsNull;
     IsReference = sBase.IsReference;
     Mode        = sBase.Mode;
 }
 public CSerializable(SerializedBase serializable, object value)
 {
     Value        = value;
     Serializable = serializable;
 }
Example #8
0
 public void Add(SerializedBase value)
 {
     Values.Add(value);
 }