using System;
using System.Text;

namespace GameData{
    /// <summary>
    /// 消息数据
    /// </summary>
    public class MessageData {
        /// <summary>
        /// 0 全服喊话  1单游喊话  2全桌喊话  3全竞技比赛喊话(clubid)  4私聊(userid)
        /// </summary>
        public int msgStyle;

        /// <summary>
        /// 当是竞技比赛喊话时 是竞技比赛id  当是私聊时 是玩家userid
        /// </summary>
        public int serverid;

        /// <summary>
        /// 文本内容 
        /// </summary>
        public string context;

        /// <summary>
        /// 发送者userid
        /// </summary>
        public int receiveId;

        /// <summary>
        /// 发送者昵称
        /// </summary>
        public string receiveNickName;

        /// <summary>
        /// 发送者经验
        /// </summary>
        public int receiveExp;

        /// <summary>
        /// 
        /// </summary>
        public MessageData() { }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="msgStyle"></param>
        /// <param name="context"></param>
        /// <param name="serverid"></param>
        public MessageData(int msgStyle,string context,int serverid) {
            this.msgStyle = msgStyle;
            this.context = context;
            this.serverid = serverid;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public override string ToString() {
            StringBuilder sb = new StringBuilder();
            sb.Append("msgSty: ");
            sb.Append(msgStyle);
            sb.Append(Environment.NewLine);
            sb.Append("context:");
            sb.Append(context);
            sb.Append(Environment.NewLine);
            sb.Append("serverid:");
            sb.Append(serverid);
            sb.Append(Environment.NewLine);
            sb.Append("receiveId:");
            sb.Append(receiveId);
            sb.Append(Environment.NewLine);
            sb.Append("receiveNickName:");
            sb.Append(receiveNickName);
            sb.Append(Environment.NewLine);
            sb.Append("receiveExp:");
            sb.Append(receiveExp);

            return sb.ToString();
        }

    }
}
