/// <summary> /// 增加头部属性 /// </summary> /// <param name="propertyStruct"></param> private void PushHeadProperty(DataStruct propertyStruct) { dataStruct.PushHeadProperty(propertyStruct); }
/// <summary> /// 将数据加到栈尾 /// </summary> /// <param name="obj"></param> public void PushIntoStack(DataStruct obj) { dataStruct.PushIntoStack(obj); }
/// <summary> /// 增加头部属性 /// </summary> /// <param name="propertyStruct"></param> internal void PushHeadProperty(DataStruct propertyStruct) { _propertyStruct = propertyStruct; }
/// <summary> /// 内部输出Action的值 /// </summary> /// <returns>无</returns> protected void InternalWriteAction(BaseGameResponse response) { foreach (object obj in arrayList) { Type type = obj.GetType(); if (type == typeof(String)) { WriteString(response, Convert.ToString(obj)); } else if (type == typeof(double)) { WriteDouble(response, Convert.ToDouble(obj)); } else if (type == typeof(float)) { WriteFloat(response, Convert.ToSingle(obj)); } else if (type == typeof(Int64)) { WriteLong(response, Convert.ToInt64(obj)); } else if (type == typeof(Int32) || type.IsEnum) { WriteInt(response, Convert.ToInt32(obj)); } else if (type == typeof(Int16)) { WriteShort(response, Convert.ToInt16(obj)); } else if (type == typeof(UInt64)) { WriteULong(response, Convert.ToUInt64(obj)); } else if (type == typeof(UInt32)) { WriteUInt(response, Convert.ToUInt32(obj)); } else if (type == typeof(UInt16)) { WriteUShort(response, Convert.ToUInt16(obj)); } else if (type == typeof(Byte)) { WriteByte(response, Convert.ToByte(obj)); } else if (type == typeof(bool)) { WriteBool(response, Convert.ToBoolean(obj)); } else if (type == typeof(DateTime)) { WriteDateTime(response, Convert.ToDateTime(obj)); } else if (type == typeof(DataStruct)) { DataStruct ds = ((DataStruct)obj); ds.WriteActionNum(response); ds.InternalWriteAction(response); } else if (type == typeof(byte[])) { //By Seamoon已序列化好的内容,直接写入 var bytes = (byte[])(obj); WriteInt(response, bytes.Length); response.Write(bytes); } } }
/// <summary> /// 将数据加到栈尾 /// </summary> /// <param name="obj"></param> public void PushIntoStack(DataStruct obj) { PushIntoStackObj(obj); }