using ObjectModel.Club;
using Server.Core;

namespace Server.AliyunSDK.SLSLog
{
    /// <summary>
    /// 俱乐部用户上下分日志
    /// </summary>
    public class ClubUserScoreLogData : SLSLogData
    {
        /// <summary>
        /// 俱乐部ID
        /// </summary>
        public int ClubId;
        /// <summary>
        /// 俱乐部比赛ID
        /// </summary>
        public int ClubMatchId;
        /// <summary>
        /// 用户ID
        /// </summary>
        public int UserId;
        /// <summary>
        /// 类型ID
        /// </summary>
        public int TypeId; 
        /// <summary>
        /// 操作分值
        /// </summary>
        public double Score; 
        /// <summary>
        /// 这把玩家扣除的桌费
        /// </summary>
        public double DeskScore; 
        /// <summary>
        /// 新的分数， 操作完之后的分数
        /// </summary>
        public double NewScore;

        public static ClubUserScoreLogData Create(ClubMatchScoreNotes note)
        {
            ClubUserScoreLogData data = ReferencePool.Fetch<ClubUserScoreLogData>();
            data.ClubId = note.ClubId;
            data.ClubMatchId = note.ClubMatchId;
            data.UserId = note.UserId;
            data.TypeId = note.TypeId;
            data.Score = note.Score;
            data.DeskScore = note.DeskScore;
            data.Time = note.CreateTime;
            data.NewScore = note.NewScore;
            return data;
        }
    }
}