
using MessagePack;

namespace GameMessage
{
    /// <summary>
    /// 服务器的游戏配置
    /// </summary>
    [MessagePackObject]
    public class ServerGameConfig
    {
        /// <summary>
        /// 服务器游戏ID
        /// </summary>
        [Key(0)]
        public int ServerGameId;

        /// <summary>
        /// ClientGameId
        /// </summary>
        [Key(1)]
        public int ClientGameId;

        /// <summary>
        /// 开启模式 0 只有金币场 1 只有朋友房 2 金币+朋友房
        /// </summary>
        [Key(2)]
        public byte OpenMode;
        
        /// <summary>
        /// 城堡
        /// </summary>
        [Key(3)]
        public GameCastleConfig[] CastleConfigs;
        
        /// <summary>
        /// 厅
        /// </summary>
        [Key(4)]
        public GameTingConfig[] TingConfigs;
    }

    [MessagePackObject]
    public class GameCastleConfig
    {
        /// <summary>
        /// 厅的ID
        /// </summary>
        [Key(0)]
        public int[] TingIds;

        /// <summary>
        /// Id
        /// </summary>
        [Key(1)]
        public int Id;
        
        /// <summary>
        /// 倍率
        /// </summary>
        [Key(2)]
        public int BeiLv;

        /// <summary>
        /// 税收
        /// </summary>
        [Key(3)]
        public int Tax;

        /// <summary>
        /// 经验值
        /// </summary>
        [Key(4)]
        public int Exp;

        /// <summary>
        /// 最小可进的金额
        /// </summary>
        [Key(5)]
        public int MinMoney;

        /// <summary>
        /// 最大可进的金额 0 表示不限制
        /// </summary>
        [Key(6)]
        public int MaxMoney;

        /// <summary>
        /// 是否是朋友房的房间
        /// </summary>
        [Key(7)]
        public bool IsFriend;
    }

    [MessagePackObject]
    public class GameTingConfig
    {
        /// <summary>
        /// 后续扩展用，现在还没用上，如果下次改成厅包含城堡，这个就用的上了
        /// </summary>
        [Key(0)]
        public int[] CastleIds;
        
        /// <summary>
        /// Id
        /// </summary>
        [Key(1)]
        public int Id;
        
        /// <summary>
        /// 厅的名称
        /// </summary>
        [Key(2)]
        public string Name;

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

        /// <summary>
        /// 最大玩家数量
        /// </summary>
        [Key(4)]
        public int MaxPlayerCnt;
        
        /// <summary>
        /// 是否是朋友房的房间
        /// </summary>
        [Key(5)]
        public bool IsFriend;
    }

    /// <summary>
    /// 城堡奖励
    /// </summary>
    [MessagePackObject]
    public class CastleRewardData
    {
        /// <summary>
        /// 城堡奖励
        /// </summary>
        [Key(0)]
        public CastleReward[] Reward;
    }

    [MessagePackObject]
    public class CastleReward
    {
        [Key(0)]
        public int CastleId;
        
        [Key(1)]
        public GameRewardResData[] Reward;
    }

}