package com.loganmagnan.eventcore.commands;

import com.loganmagnan.eventcore.EventCore;
import com.loganmagnan.eventcore.menusystem.menus.EventManageMenu;
import com.loganmagnan.eventcore.utils.ColorUtils;
import com.loganmagnan.eventcore.utils.Constants;
import com.loganmagnan.eventcore.utils.Utils;
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 EventCommand extends BaseCommand {

    private EventCore main = EventCore.getInstance();

    @Command(name = "event", permission = "eventcore.command.event")
    @Override
    public void executeAs(CommandArguments command) {
        Player player = command.getPlayer();

        String[] args = command.getArgs();

        if (args.length == 0) {
            for (String string : Constants.COMMAND_MESSAGES.get("event.help")) {
                player.sendMessage(ColorUtils.getMessageType(string.replace("%line%", Utils.chatBar)));
            }
        } else {
            switch (args[0]) {
                case "start":
                    // To Do: Setup Event Starting System

                    break;
                case "stop":
                    // To Do: Setup Event Stopping System

                    break;
                case "manage":
                    new EventManageMenu(this.main.getPlayerMenuUtil(player)).open(player);

                    break;
            }
        }
    }
}
