/* Copyright (c) 2019 yvt This file is part of OpenSpades. OpenSpades is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenSpades is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenSpades. If not, see . */ #include "Client.h" #include namespace spades { namespace client { namespace { constexpr const char *CMD_SAVEMAP = "savemap"; std::map const g_clientCommands{ {CMD_SAVEMAP, ": Save the current state of the map to the disk"}, }; } // namespace bool Client::ExecCommand(const Handle &cmd) { if (cmd->GetName() == CMD_SAVEMAP) { if (cmd->GetNumArguments() != 0) { SPLog("Usage: %s (no arguments)", CMD_SAVEMAP); return true; } TakeMapShot(); return true; } else { return false; } } Handle Client::AutocompleteCommandName(const std::string &name) { return gui::MakeCandidates(g_clientCommands, name); } } // namespace client } // namespace spades