package net.cobem.grizzly.habbohotel.misc.commands;

import net.cobem.grizzly.Grizzly;
import net.cobem.grizzly.communication.composers.misc.SendNotificationComposer;
import net.cobem.grizzly.habbohotel.misc.ChatCommand;
import net.cobem.grizzly.habbohotel.sessions.Session;

public class CommandList implements ChatCommand {
    @Override
    public int rank() {
        return 0;
    }

    @Override
    public void execute(Session session, String[] args) {
        String str = "Available Commands\n";

        boolean NewLine = false;

        for (String command : Grizzly.getHabboHotel().getCommands().getList().keySet()) {
            str += command;

            if (NewLine) {
                str += "\n";
            } else {
                str += ",         ";
            }

            NewLine = !NewLine;
        }

        session.sendResponse(SendNotificationComposer.compose(str));
    }
}
