public static DDFBase Create(DDFType type) { switch (type) { case DDFType.Bool: return(new DDFBool()); case DDFType.Byte: return(new DDFByte()); case DDFType.ByteArray: return(new DDFByteArray()); case DDFType.Char: return(new DDFChar()); case DDFType.Double: return(new DDFDouble()); case DDFType.Float: return(new DDFFloat()); case DDFType.Int: return(new DDFInt()); case DDFType.List: return(new DDFList()); case DDFType.Long: return(new DDFLong()); case DDFType.Map: return(new DDFMap()); case DDFType.SByte: return(new DDFSByte()); case DDFType.Short: return(new DDFShort()); case DDFType.String: return(new DDFString()); case DDFType.UInt: return(new DDFUInt()); case DDFType.ULong: return(new DDFULong()); case DDFType.UShort: return(new DDFUShort()); default: return(null); } }
public override void Deserialize(DataStream dataStream) { entries.Clear(); this.listType = (DDFType)dataStream.ReadByte(); ushort count = dataStream.ReadUShort(); for (int i = 0; i < count; i++) { DDFBase entry = DDFFactory.Create(listType); entry.Deserialize(dataStream); entries.Add(entry); } }
public override void Deserialize(DataStream dataStream) { entries.Clear(); ushort count = dataStream.ReadUShort(); for (int i = 0; i < count; i++) { DDFString entryName = new DDFString(); entryName.Deserialize(dataStream); DDFType entryType = (DDFType)dataStream.ReadByte(); DDFBase entry = DDFFactory.Create(entryType); entry.Deserialize(dataStream); entries.Add(entryName.Value, entry); } }
public DDFValueBase(DDFType type) : base(type) { this.Value = default(T); }
public DDFPrimitiveBase(DDFType type) : base(type) { }
public DDFList(DDFType listType) : base(DDFType.List) { this.entries = new ArrayList <DDFBase>(); this.listType = listType; }
public DDFBase(DDFType type) { this.type = type; }