Esempio n. 1
0
            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);
            }
Esempio n. 2
0
 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());
     }
 }
Esempio n. 3
0
            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);
                }
            }
Esempio n. 4
0
 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);
     }
 }
Esempio n. 5
0
            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);
                //	}
                //}
            }
Esempio n. 6
0
 public override void WriteToBinary(IConfigBinary binary, IData obj)
 {
     binary.Write((int)obj.Object);
 }
Esempio n. 7
0
 public void WriteToPool(IConfigBinary binary, IPooledData obj)
 {
     binary.Write((string)obj.Object);
 }
Esempio n. 8
0
 public override void WriteToBinary(IConfigBinary binary, IData obj)
 {
     binary.Write(((IPooledData)obj).GetPoolIndex(binary));
 }