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

namespace GameMessage
{
    /// <summary>
    /// 游戏内的桌子信息
    /// </summary>
    [MessagePackObject]
    public class GameDeskInfo
    {
        /// <summary>
        /// 位置信息
        /// </summary>
        [Key(0)] public int[] Seat;
    }

    [MessagePackObject]
    public class DeskRulePack
    {
        /// <summary>
        /// 最大玩家数量
        /// </summary>
        [Key(0)]public int MaxCnt;

        /// <summary>
        /// 最小玩家数量
        /// </summary>
        [Key(1)]public int MinCnt;

        /// <summary>
        /// 战斗场次
        /// </summary>
        [Key(2)]public int WarCnt;

        /// <summary>
        /// 游戏的服务器id
        /// </summary>
        [Key(3)]public int GameSerId;

        /// <summary>
        /// 是否拦截ip
        /// </summary>
        [Key(4)]public int InterceptIp;

        /// <summary>
        /// 地理位置拦截
        /// </summary>
        [Key(5)]public int InterceptPos;

        /// <summary>
        /// 是否拦截不是微信的账号
        /// </summary>
        [Key(6)]public int InterceptWeChat;

        /// <summary>
        /// 客户端拓展，只保存,服务器不处理
        /// </summary>
        [Key(7)]public List<string> Ex;

        /// <summary>
        /// 赔率
        /// </summary>
        [Key(8)]public float Peilv;

        /// <summary>
        /// 房间规则
        /// </summary>
        [Key(9)]public string Roomrule;

        /// <summary>
        /// 多少数封顶，总结算的封顶（子乘倍率的,就是最后封顶输多少钱） 等于0的值就是有封顶，要不就没有封顶
        /// </summary>
        [Key(10)]public int Capping;

        /// <summary>
        /// 玩法备注
        /// </summary>
        [Key(11)]public string Remarks;

        /// <summary>
        /// 规则拓展
        /// </summary>
        [Key(12)]public DeskRuleEx RuleEx;
    }

    [MessagePackObject]
    public class DeskPlayerDataPack
    {
        /// <summary>
        /// 玩家ID
        /// </summary>
        [Key(0)]
        public int UserId;

        /// <summary>
        /// 玩家昵称
        /// </summary>
        [Key(1)]
        public string NickName;

        /// <summary>
        /// 玩家性别
        /// </summary>
        [Key(2)]
        public int Sex;

        /// <summary>
        /// 是否房主
        /// </summary>
        [Key(3)]
        public int FangZhu;

        /// <summary>
        /// 客户端IP地址
        /// </summary>
        [Key(4)]
        public string ClientIp;

        /// <summary>
        /// 玩家所属俱乐部ID
        /// </summary>
        [Key(5)]
        public int ClubId;
    }
    

    [MessagePackObject]
    public class DeskBureauPack
    {
        /// <summary>
        /// 当前局
        /// </summary>
        [Key(0)]public int Id;

        /// <summary>
        /// 玩家分数
        /// </summary>
        [Key(1)]public List<long> PlayScore;

        /// <summary>
        /// 玩家的座位
        /// </summary>
        [Key(2)]public List<int> Seat;
    }

    [MessagePackObject]
    public class DeskSummaryBureauPack
    {
        [Key(0)]public int Seat;
        [Key(1)]public decimal Score;
    }

    [MessagePackObject]
    public class DeskInfoPack
    {
        /// <summary>
        /// 唯一码   其他模块应持有这个
        /// </summary>
        [Key(0)]public string Weiyima;

        /// <summary>
        /// 房间号  不是唯一的,同一时间运算的是唯一的  6为数房间码
        /// </summary>
        [Key(1)]public string RoomNum;

        /// <summary>
        /// 房间规则
        /// </summary>
        [Key(2)]public DeskRulePack Rule;

        /// <summary>
        /// 当前数量的场数 1开始
        /// </summary>
        [Key(3)]public int NowCnt;

        /// <summary>
        /// 结束的数量
        /// </summary>
        [Key(4)]public int OverCnt;

        /// <summary>
        /// 游戏服务器的版本
        /// </summary>
        [Key(5)]public int ServerVer;

        /// <summary>
        /// 创建房间的类型      0普通开  1代开房间  5竞技比赛创建房间
        /// </summary>
        [Key(6)]public int CreatStyle;

        /// <summary>
        /// 创建房间的id 如果是普通创建的房间 则此id为玩家的userid   竞技比赛创建则为竞技比赛id
        /// </summary>
        [Key(7)]public int CreatUserid;

        /// <summary>
        /// 创建房间的房卡数量
        /// </summary>
        [Key(8)]public int Fangka;

        /// <summary>
        /// 玩家数据
        /// </summary>
        [Key(9)]public List<DeskPlayerDataPack> Pls;

        /// <summary>
        /// 玩家座位 当前的座位编号  --里面存储的座位
        /// </summary>
        [Key(10)]public List<int> Seat;

        /// <summary>
        /// 每局明细
        /// </summary>
        [Key(11)]public List<DeskBureauPack> Burs;

        /// <summary>
        /// 一局打完总的结算，如果有封顶的话，里面计算好了封顶之后的分值
        /// </summary>
        [Key(12)]public List<DeskSummaryBureauPack> SumBurs;

        /// <summary>
        /// 创建时间
        /// </summary>
        [Key(13)]public DateTime CreateTime;

        /// <summary>
        /// 关闭时间
        /// </summary>
        [Key(14)]public DateTime CloseTime;
    }
}