using System.Collections.Generic;
using Thousandto.Plugins.Common;
using Thousandto.Code.Logic.Network;

namespace MSG_Melting
{
    public partial class ReqOpenMelting : ProtoBuf.IExtensible, ProtoBuf.IReqMessage
    {
    
        public const uint MsgID = 154201;
        public void Excute(){}
        public void Send()
        {
            lock (ProtoBufUtils.WriteLocker)
            {
                byte[] bytes = null;
                ProtoBufUtils.InitWriteData();
                bytes = ProtoBufUtils.GetData();
                Thousandto.Plugins.Common.Networker.Instance.Send(bytes, MsgID);
            }
        }
        public void Clear()
        {
        }
    }
    public partial class Material : ProtoBuf.IMessageInfo, ProtoBuf.IExtensible
    {
        public void Send(){}
        public void Excute(){}
        public void ReadMessage(ref int readPos, int totalCount)
        {
            int endIndex = totalCount + readPos - 1;
            while (readPos <= endIndex)
            {
                int fieldNumber = ProtoBufUtils.ReadFieldNumber(ref readPos);
                switch (fieldNumber)
                {
                    case 1 :
                        itemId = ProtoBufUtils.ReadInt32(ref readPos);
                        break;
                    case 2 :
                        count = ProtoBufUtils.ReadInt32(ref readPos);
                        break;
                    default:
                        break;
                }
            }
        }
        public int WriteMessage(int fieldNumber)
        {
            ProtoBufUtils.WriteHeader(fieldNumber, ProtoBuf.WireType.String);
            int subItemInfoId = ProtoBufUtils.GetSubItemInfoId();
            ProtoBufUtils.SetEmptyLength(subItemInfoId);
            ProtoBufUtils.SetVBeginIndex(subItemInfoId);
                ProtoBufUtils.WriteInt32(1,itemId);
                ProtoBufUtils.WriteInt32(2,count);
            ProtoBufUtils.SetVEndIndex(subItemInfoId);
            return ProtoBufUtils.CheckAndSetLength(subItemInfoId);
        }
        public void Clear()
        {
             itemId = 0;
             count = 0;
        }
        public int itemId;
        public int count;
    }
    public partial class ResOpenMeltingRes : ProtoBuf.IExtensible, ProtoBuf.IResMessage
    {
        public void Excute()
        {
			HandleMsgResult.getInstance().GS2U_ResOpenMeltingRes(this);
        }
    
        public const uint MsgID = 154101;
        public void Send(){}
        public void ReadMessage(byte[] bytes)
        {
            lock (ProtoBufUtils.ReadLocker)
            {
                Clear();
                int endIndex = bytes.Length - 1;
                int readPos = 0;
                int totalCount = 0;
                ProtoBufUtils.InitReadData(bytes, ref readPos);
                while (readPos <= endIndex)
                {
                    int curType = bytes[readPos] & 7;
                    int fieldNumber = ProtoBufUtils.ReadFieldNumber(ref readPos);
                    switch (fieldNumber)
                    {
                        case 1:
                        curCount = ProtoBufUtils.ReadInt32(ref readPos);
                            break;
                        case 2:
                        if(material == null)
                        {
                          material = new List<Material>();
                        }
                        material.Add(new Material());
                        totalCount = ProtoBufUtils.ReadInt32(ref readPos);
                        material[material.Count - 1].ReadMessage(ref readPos, totalCount);
                            break;
                        default:
                            break;
                    }
                }
            }
        }
        public void Clear()
        {
             curCount = 0;
             if(material != null)
             {
                material.Clear();
             }
        }
        public int curCount;
        public List<Material> material =  new List<Material>();
    }
    public partial class ReqResetMaterial : ProtoBuf.IExtensible, ProtoBuf.IReqMessage
    {
    
        public const uint MsgID = 154202;
        public void Excute(){}
        public void Send()
        {
            lock (ProtoBufUtils.WriteLocker)
            {
                byte[] bytes = null;
                ProtoBufUtils.InitWriteData();
                bytes = ProtoBufUtils.GetData();
                Thousandto.Plugins.Common.Networker.Instance.Send(bytes, MsgID);
            }
        }
        public void Clear()
        {
        }
    }
    public partial class ResResetMaterialRes : ProtoBuf.IExtensible, ProtoBuf.IResMessage
    {
        public void Excute()
        {
			HandleMsgResult.getInstance().GS2U_ResResetMaterialRes(this);
        }
    
        public const uint MsgID = 154102;
        public void Send(){}
        public void ReadMessage(byte[] bytes)
        {
            lock (ProtoBufUtils.ReadLocker)
            {
                Clear();
                int endIndex = bytes.Length - 1;
                int readPos = 0;
                int totalCount = 0;
                ProtoBufUtils.InitReadData(bytes, ref readPos);
                while (readPos <= endIndex)
                {
                    int curType = bytes[readPos] & 7;
                    int fieldNumber = ProtoBufUtils.ReadFieldNumber(ref readPos);
                    switch (fieldNumber)
                    {
                        case 1:
                        if(material == null)
                        {
                          material = new List<Material>();
                        }
                        material.Add(new Material());
                        totalCount = ProtoBufUtils.ReadInt32(ref readPos);
                        material[material.Count - 1].ReadMessage(ref readPos, totalCount);
                            break;
                        default:
                            break;
                    }
                }
            }
        }
        public void Clear()
        {
             if(material != null)
             {
                material.Clear();
             }
        }
        public List<Material> material =  new List<Material>();
    }
    public partial class ResUpdateCount : ProtoBuf.IExtensible, ProtoBuf.IResMessage
    {
        public void Excute()
        {
			HandleMsgResult.getInstance().GS2U_ResUpdateCount(this);
        }
    
        public const uint MsgID = 154103;
        public void Send(){}
        public void ReadMessage(byte[] bytes)
        {
            lock (ProtoBufUtils.ReadLocker)
            {
                Clear();
                int endIndex = bytes.Length - 1;
                int readPos = 0;
                int totalCount = 0;
                ProtoBufUtils.InitReadData(bytes, ref readPos);
                while (readPos <= endIndex)
                {
                    int curType = bytes[readPos] & 7;
                    int fieldNumber = ProtoBufUtils.ReadFieldNumber(ref readPos);
                    switch (fieldNumber)
                    {
                        case 1:
                        count = ProtoBufUtils.ReadInt32(ref readPos);
                            break;
                        default:
                            break;
                    }
                }
            }
        }
        public void Clear()
        {
             count = 0;
        }
        public int count;
    }
    public partial class ReqMelting : ProtoBuf.IExtensible, ProtoBuf.IReqMessage
    {
    
        public const uint MsgID = 154204;
        public void Excute(){}
        public void Send()
        {
            lock (ProtoBufUtils.WriteLocker)
            {
                byte[] bytes = null;
                ProtoBufUtils.InitWriteData();
                bytes = ProtoBufUtils.GetData();
                Thousandto.Plugins.Common.Networker.Instance.Send(bytes, MsgID);
            }
        }
        public void Clear()
        {
        }
    }
    public partial class ResSendMaterialRes : ProtoBuf.IExtensible, ProtoBuf.IResMessage
    {
        public void Excute()
        {
			HandleMsgResult.getInstance().GS2U_ResSendMaterialRes(this);
        }
    
        public const uint MsgID = 154104;
        public void Send(){}
        public void ReadMessage(byte[] bytes)
        {
            lock (ProtoBufUtils.ReadLocker)
            {
                Clear();
                int endIndex = bytes.Length - 1;
                int readPos = 0;
                int totalCount = 0;
                ProtoBufUtils.InitReadData(bytes, ref readPos);
                while (readPos <= endIndex)
                {
                    int curType = bytes[readPos] & 7;
                    int fieldNumber = ProtoBufUtils.ReadFieldNumber(ref readPos);
                    switch (fieldNumber)
                    {
                        case 1:
                        itemId = ProtoBufUtils.ReadInt32(ref readPos);
                            break;
                        case 2:
                        count = ProtoBufUtils.ReadInt32(ref readPos);
                            break;
                        default:
                            break;
                    }
                }
            }
        }
        public void Clear()
        {
             itemId = 0;
             count = 0;
        }
        public int itemId;
        public int count;
    }
}