package com.loganmagnan.eventcore.commands;

import com.loganmagnan.eventcore.EventCore;
import com.loganmagnan.eventcore.utils.command.BaseCommand;
import com.loganmagnan.eventcore.utils.command.Command;
import com.loganmagnan.eventcore.utils.command.CommandArguments;
import org.bukkit.entity.Player;

public class StaffModeCommand extends BaseCommand {

    private EventCore main = EventCore.getInstance();

    @Command(name = "staffmode", permission = "eventcore.command.staffmode", aliases = {"staff", "mode", "sm", "mod", "moderator", "moderatormode"})
    @Override
    public void executeAs(CommandArguments command) {
        Player player = command.getPlayer();

        String[] args = command.getArgs();

        if (args.length == 0) {
            if (this.main.getStaffManager().getPlayersInStaffMode().contains(player.getUniqueId())) {
                this.main.getStaffManager().setStaffMode(player, false);
            } else {
                this.main.getStaffManager().setStaffMode(player, true);
            }
        }
    }
}
