#pragma once

void Cmd_Scoreboard_SetFields(int argc);
void Cmd_Scoreboard_Help();
void ConsoleCommand_macro_init();

// used by common/command/generic.qc:GenericCommand_dumpcommands to list all commands into a .txt file
void LocalCommand_macro_write_aliases(int fh);

REGISTRY(CLIENT_COMMANDS, BITS(7))
REGISTER_REGISTRY(CLIENT_COMMANDS)
REGISTRY_SORT(CLIENT_COMMANDS)

REGISTRY_DEFINE_GET(CLIENT_COMMANDS, NULL)

#define CLIENT_COMMAND(id, description) \
	CLASS(clientcommand_##id, Command) \
		ATTRIB(clientcommand_##id, m_name, string, #id); \
    	ATTRIB(clientcommand_##id, m_description, string, description); \
	ENDCLASS(clientcommand_##id) \
    REGISTER(CLIENT_COMMANDS, CMD_CL, id, m_id, NEW(clientcommand_##id)); \
	METHOD(clientcommand_##id, m_invokecmd, void(clientcommand_##id this, int request, entity caller, int arguments, string command))

STATIC_INIT(CLIENT_COMMANDS_aliases) {
	FOREACH(CLIENT_COMMANDS, true, localcmd(sprintf("alias %1$s \"%2$s %1$s ${* ?}\"\n", it.m_name, "qc_cmd_cl")));
}
