44 virtual bool execute(
const std::string& parameters) = 0;
51 virtual std::weak_ptr<DtChatCommand>
getWeak() {
return shared_from_this(); }
60 virtual std::string
help(
const std::string& parameters) {
return parameters; };
79 const std::string& stringToSplit, std::vector<std::string>& tokenized,
const char delimiter =
' ');
121 std::string commandString, std::shared_ptr<DtChatCommand> command,
bool takeOwnership =
false);
148 virtual std::string
helpText(
const std::string& parameters)
const;
156 std::unordered_map<std::string, std::weak_ptr<DtChatCommand>>
myCommandMap;
Abstract base class for chat commands in VR-Engage.
Definition vreChatCommandsManager.h:30
virtual std::string help(const std::string ¶meters)
Gets help text for the command.
Definition vreChatCommandsManager.h:60
static bool splitString(const std::string &stringToSplit, std::vector< std::string > &tokenized, const char delimiter=' ')
Utility function to split a string into tokens.
virtual std::weak_ptr< DtChatCommand > getWeak()
Gets a weak pointer to this command.
Definition vreChatCommandsManager.h:51
~DtChatCommand()=default
Virtual destructor.
virtual bool execute(const std::string ¶meters)=0
Executes the command with given parameters.
virtual bool showInHelp() const
Checks if this command should be visible in help listings.
Definition vreChatCommandsManager.h:68
virtual void removeCommand(std::string commandString)
Unregisters a chat command.
DtChatCommandsManager & operator=(const DtChatCommandsManager &orig)=delete
Deleted copy constructor and assignment operatorThese operations are not supported for the command ma...
DtPlayerStationApp & myApp
Reference to the player station application.
Definition vreChatCommandsManager.h:168
DtChatCommandsManager(DtPlayerStationApp &app)
Constructor.
virtual bool runCommand(std::string consoleString)
Executes a command from a console input string.
std::unordered_map< std::string, std::shared_ptr< DtChatCommand > > myOwnedCommandMap
Map of command strings to shared pointers to commands.
Definition vreChatCommandsManager.h:163
~DtChatCommandsManager()
Destructor.
DtChatCommandsManager(const DtChatCommandsManager &orig)=delete
Deleted copy constructor and assignment operatorThese operations are not supported for the command ma...
std::unordered_map< std::string, std::weak_ptr< DtChatCommand > > myCommandMap
Map of command strings to weak pointers to commands.
Definition vreChatCommandsManager.h:156
virtual bool addCommand(std::string commandString, std::shared_ptr< DtChatCommand > command, bool takeOwnership=false)
Registers a new chat command.
virtual std::string helpText(const std::string ¶meters) const
Generates help text for available commands.
Top-level class representing the VR-Engage application.
Definition playerStationApp.h:163
Defines export macros for the VR-Engage Player Station library.
#define PLAYERSTATION_DLL
Definition export.h:24
Include export definitions for this library.
Definition glsVreMessageUtil.h:49