using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using Plus.Database.Interfaces;


namespace Plus.HabboHotel.Rooms.Chat.Commands.Administrator
{
    class DeleteGroupCommand : IChatCommand
    {
        public string PermissionRequired
        {
            get { return "command_delete_group"; }
        }

        public string Parameters
        {
            get { return ""; }
        }

        public string Description
        {
            get { return "Supprimer un groupe à partir de la base de données."; }
        }

        public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
        {
            Room = Session.GetHabbo().CurrentRoom;
            if (Room == null)
                return;

            if (Room.Group == null)
            {
                Session.SendWhisper("Oops, il n'y a pas de groupe ici?", 34);
                return;
            }

            PlusEnvironment.GetGame().GetGroupManager().DeleteGroup(Room.RoomData.Group);

            Room.Group = null;

            Room.RoomData.Group = null;

            PlusEnvironment.GetGame().GetRoomManager().UnloadRoom(Room, true);

            Session.SendNotification("Supression du groupe");
            return;
        }
    }
}
