1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-04 01:37:47 +00:00
sapphire/src/servers/sapphire_zone/DebugCommand/DebugCommand.h

64 lines
951 B
C
Raw Normal View History

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
#include "ForwardsZone.h"
2017-08-08 13:53:47 +02:00
namespace Core {
class DebugCommandHandler;
2017-08-08 13:53:47 +02:00
class DebugCommand
{
public:
2017-08-08 13:53:47 +02:00
2018-10-25 12:44:51 +11:00
using pFunc = void ( DebugCommandHandler::* )( char*, Entity::Player&, std::shared_ptr< DebugCommand > );
2017-08-08 13:53:47 +02:00
// String for the command
std::string m_commandName;
2017-08-08 13:53:47 +02:00
// command callback
pFunc m_pFunc;
2017-08-08 13:53:47 +02:00
// helptext
std::string m_helpText;
2017-08-08 13:53:47 +02:00
// userlevel needed to execute the command
uint8_t m_gmLevel;
2017-08-08 13:53:47 +02:00
DebugCommand( const std::string& n, pFunc functionPtr, const std::string& hText, uint8_t uLevel )
{
m_commandName = n;
m_pFunc = functionPtr;
m_helpText = hText;
m_gmLevel = uLevel;
}
2017-08-08 13:53:47 +02:00
~DebugCommand()
{
2017-08-08 13:53:47 +02:00
}
2017-08-08 13:53:47 +02:00
const std::string& getName() const
{
return m_commandName;
}
2017-08-08 13:53:47 +02:00
const std::string& getHelpText() const
{
return m_helpText;
}
2017-08-08 13:53:47 +02:00
uint8_t getRequiredGmLevel() const
{
return m_gmLevel;
}
2017-08-08 13:53:47 +02:00
};
2017-08-08 13:53:47 +02:00
}
#endif