private static 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));
        }
示例#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);
        }
示例#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);
            }
        }
 public void Add(string name, SerializedBase value)
 {
     Values.Add(name, value);
 }
 public SerializedClass(SerializedBase sBase) : base(sBase.ID, sBase.Type)
 {
     IsNull      = sBase.IsNull;
     IsReference = sBase.IsReference;
     Mode        = sBase.Mode;
 }
示例#7
0
 public void Add(SerializedBase value)
 {
     Values.Add(value);
 }
 public CSerializable(SerializedBase serializable, object value)
 {
     Value        = value;
     Serializable = serializable;
 }