using System;
using System.Collections.Generic;
using MessagePack;

namespace GameMessage
{
    [MessagePackObject]
    public class WarGoldRecordItemData
    {
        public const string UserIdName = nameof(UserId);

        public const string ScoreName = nameof(Score);
        
        public const string ContentName = nameof(Content);
        
        public const string GameIdName = nameof(GameId);
        
        public const string BeiLvName = nameof(BeiLv);
        
        public const string TaxName = nameof(Tax);
        
        public const string RoomIdName = nameof(RoomId);
        
        public const string EndTimeName = nameof(EndTime);
        
        public const string DescriptionName = nameof(Description);
        
        /// <summary>
        /// 玩家
        /// </summary>
        [Key(0)]
        public int UserId;

        /// <summary>
        /// 这一局得分数
        /// </summary>
        [Key(1)]
        public double Score; 
        
        /// <summary>
        /// 这一局得玩家信息
        /// </summary>
        [Key(2)]
        public List<WarRecordPlayerData> Content;

        /// <summary>
        /// 游戏ID
        /// </summary>
        [Key(3)]
        public int GameId;

        /// <summary>
        /// 倍率
        /// </summary>
        [Key(4)]
        public float BeiLv;

        /// <summary>
        /// 手续费
        /// </summary>
        [Key(5)]
        public int Tax;

        /// <summary>
        /// 房间号
        /// </summary>
        [Key(6)]
        public string RoomId;
        
        /// <summary>
        /// 结束时间
        /// </summary>
        [Key(7)]
        public string EndTime;
        
        /// <summary>
        /// 用于填一下描述信息 （如玩法、游戏名称）
        /// </summary>
        [Key(8)]
        public string Description;
    }

    [Serializable]
    [MessagePackObject]
    public class WarRecordPlayerData
    {
        /// <summary>
        /// 用户ID
        /// </summary>
        [Key(0)]
        public int UserId;
        
        /// <summary>
        /// 战绩分数
        /// </summary>
        [Key(1)]
        public double Score;
    }
}