public override void WriteToBinary(IConfigBinary binary, IData obj) { List <IData> data = (List <IData>)obj.Object; binary.Write((float)data[0].Object); binary.Write((float)data[1].Object); }
public override void WriteToBinary(IConfigBinary binary, IData obj) { if (obj.Object == null) { binary.Write(-1L); } else { DateTime dt = (DateTime)obj.Object; binary.Write(new DateTimeOffset(dt).ToUnixTimeSeconds()); } }
public virtual void WriteToPool(IConfigBinary binary, IPooledData obj) { PooledArrayData arrayData = (PooledArrayData)obj; binary.Write(arrayData.Count); foreach (var data in arrayData.Data) { data.WriteToBinary(binary); } }
public override void WriteToBinary(IConfigBinary binary, IData data) { if (typeof(T) == typeof(int)) { binary.Write((int)data.Object); } else if (typeof(T) == typeof(uint)) { binary.Write((uint)data.Object); } else if (typeof(T) == typeof(float)) { binary.Write((float)data.Object); } else if (typeof(T) == typeof(long)) { binary.Write((long)data.Object); } else if (typeof(T) == typeof(ulong)) { binary.Write((ulong)data.Object); } else if (typeof(T) == typeof(bool)) { binary.Write((bool)data.Object); } }
public override void WriteToBinary(IConfigBinary binary, IData obj) { var pooledData = obj as IPooledData; if (pooledData != null) { binary.Write(pooledData.GetPoolIndex(binary)); } //else //{ // IArrayData arrayData = (IArrayData)obj; // binary.Write(arrayData.Count); // foreach (var data in arrayData.Data) // { // data.WriteToBinary(binary); // } //} }
public override void WriteToBinary(IConfigBinary binary, IData obj) { binary.Write((int)obj.Object); }
public void WriteToPool(IConfigBinary binary, IPooledData obj) { binary.Write((string)obj.Object); }
public override void WriteToBinary(IConfigBinary binary, IData obj) { binary.Write(((IPooledData)obj).GetPoolIndex(binary)); }