using System.Collections.Generic;
using MessagePack;
#if GameClient
using GameFramework;
#endif

namespace GameMessage
{
    [Message(MessageCode.ClubMatchQuitRequest)]
    [MessagePackObject]
    public class ClubMatchQuitRequest : MessageData
    {
        [Key(0)] public int ClubId;

#if GameClient
        public static ClubMatchQuitRequest Create(int clubId)
        {
            ClubMatchQuitRequest request = ReferencePool.Acquire<ClubMatchQuitRequest>();
            request.ClubId = clubId;
            return request;
        }
#endif
    }

    [Message(MessageCode.ClubMatchQuitResponse)]
    [MessagePackObject]
    public class ClubMatchQuitResponse : MessageData
    {
        [Key(0)] public int ClubId;

        [Key(1)] public int ResultCode;
    }

    [Message(MessageCode.ClubMatchQuitDealRequest)]
    [MessagePackObject]
    public class ClubMatchQuitDealRequest : MessageData
    {
        [Key(0)] public int ClubId;

        [Key(1)] public bool IsAgree;

        [Key(2)] public bool IsResetScoreBak;

        [Key(3)] public List<UserScorePack> EditorUser;

#if GameClient
        public static ClubMatchQuitDealRequest Create(int clubId)
        {
            ClubMatchQuitDealRequest request = ReferencePool.Acquire<ClubMatchQuitDealRequest>();
            request.ClubId = clubId;
            return request;
        }

        public override void Clear()
        {
            IsAgree = false;
            IsResetScoreBak = false;
            EditorUser = null;
        }
#endif
    }

    [Message(MessageCode.ClubMatchQuitDealResponse)]
    [MessagePackObject]
    public class ClubMatchQuitDealResponse : MessageData
    {
        [Key(0)] public int ClubId;

        [Key(1)] public bool IsAgree;

        [Key(2)] public bool IsResetScoreBak;

        [Key(3)] public List<UserScorePack> EditorUser;

        [Key(4)] public int ResultCode;
    }
}