2017-08-08 13:53:47 +02:00
|
|
|
#ifndef _GAMECOMMAND_H_
|
|
|
|
#define _GAMECOMMAND_H_
|
|
|
|
|
2018-03-06 22:22:19 +01:00
|
|
|
#include <Common.h>
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2017-12-08 15:38:25 +01:00
|
|
|
#include "Forwards.h"
|
2017-08-08 13:53:47 +02:00
|
|
|
|
|
|
|
namespace Core {
|
|
|
|
|
2017-08-18 17:16:15 +02:00
|
|
|
class DebugCommandHandler;
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2017-08-18 17:16:15 +02:00
|
|
|
class DebugCommand
|
2017-08-08 13:53:47 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2017-12-08 11:46:47 +01:00
|
|
|
using pFunc = void ( DebugCommandHandler::* )( char *, Entity::Player&, boost::shared_ptr< DebugCommand > );
|
2017-08-08 13:53:47 +02:00
|
|
|
|
|
|
|
// String for the command
|
|
|
|
std::string m_commandName;
|
|
|
|
|
|
|
|
// command callback
|
|
|
|
pFunc m_pFunc;
|
|
|
|
|
|
|
|
// helptext
|
|
|
|
std::string m_helpText;
|
|
|
|
|
|
|
|
// userlevel needed to execute the command
|
2017-09-18 18:44:38 +02:00
|
|
|
uint8_t m_gmLevel;
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2017-09-18 18:44:38 +02:00
|
|
|
DebugCommand( const std::string& n, pFunc functionPtr, const std::string& hText, uint8_t uLevel )
|
2017-08-08 13:53:47 +02:00
|
|
|
{
|
|
|
|
m_commandName = n;
|
|
|
|
m_pFunc = functionPtr;
|
|
|
|
m_helpText = hText;
|
2017-09-18 18:44:38 +02:00
|
|
|
m_gmLevel = uLevel;
|
2017-08-08 13:53:47 +02:00
|
|
|
}
|
|
|
|
|
2017-08-18 17:16:15 +02:00
|
|
|
~DebugCommand()
|
2017-08-08 13:53:47 +02:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::string& getName() const
|
|
|
|
{
|
|
|
|
return m_commandName;
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::string& getHelpText() const
|
|
|
|
{
|
|
|
|
return m_helpText;
|
|
|
|
}
|
|
|
|
|
2017-09-18 18:44:38 +02:00
|
|
|
uint8_t getRequiredGmLevel() const
|
2017-08-08 13:53:47 +02:00
|
|
|
{
|
2017-09-18 18:44:38 +02:00
|
|
|
return m_gmLevel;
|
2017-08-08 13:53:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|