Core/Commands: Refactor chat command internals to slightly reduce template bloat
* Replace std::enable_if with concept constraints * Move code not dependent on template arguments out of template function bodies * Reduce number of ChatCommandResult copies made during parsing * Changed ChatCommandTable subcommands argument from std::vector<> const& to std::span<> and convert command definitions to arrays * Allow ChatHandler arguments to be const
This commit is contained in:
@@ -1787,14 +1787,14 @@ OutdoorPvP* ScriptMgr::CreateOutdoorPvP(uint32 scriptId, Map* map)
|
||||
return tmpscript->GetOutdoorPvP(map);
|
||||
}
|
||||
|
||||
Trinity::ChatCommands::ChatCommandTable ScriptMgr::GetChatCommands()
|
||||
std::vector<Trinity::ChatCommands::ChatCommandBuilder> ScriptMgr::GetChatCommands()
|
||||
{
|
||||
Trinity::ChatCommands::ChatCommandTable table;
|
||||
std::vector<Trinity::ChatCommands::ChatCommandBuilder> table;
|
||||
|
||||
FOR_SCRIPTS(CommandScript, itr, end)
|
||||
{
|
||||
Trinity::ChatCommands::ChatCommandTable cmds = itr->second->GetCommands();
|
||||
std::move(cmds.begin(), cmds.end(), std::back_inserter(table));
|
||||
std::span<Trinity::ChatCommands::ChatCommandBuilder const> cmds = itr->second->GetCommands();
|
||||
table.insert(table.end(), cmds.begin(), cmds.end());
|
||||
}
|
||||
|
||||
return table;
|
||||
|
||||
Reference in New Issue
Block a user