using System;
using Google.Protobuf;

namespace Plugins.JNGame.Network.Entity
{
    public class JNetParam
    {
        
        //请求处理 Id (用来找到处理方法)
        private int _hId;
        public int HId => _hId;

        //请求Id (请求标识)
        private int _id;
        public int ID => _id;


        //请求参数
        private IMessage _data;
        public IMessage Data => _data;
        

        private byte[] _bytes;

        public byte[] Bytes => _bytes;

        public JNetParam(int id,int hId)
        {
            _hId = hId;
            _id = id;
            _bytes = Array.Empty<byte>();
        }
        
        //构造器
        public static JNetParam Build(int id,int hId){
            return new JNetParam(id,hId);
        }
        
        
        public JNetParam SetData(IMessage data){
            this._data = data;
            return this;
        }
        public JNetParam SetByte(byte[] bytes){
            this._bytes = bytes;
            return this;
        }
        
    }
}