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
|
|
|
|
2018-09-09 23:56:22 +02:00
|
|
|
#include "ForwardsZone.h"
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2018-12-22 22:25:03 +01:00
|
|
|
|
2018-11-29 16:55:48 +01:00
|
|
|
namespace Sapphire
|
2018-10-28 21:53:21 +01:00
|
|
|
{
|
2018-12-22 22:25:03 +01:00
|
|
|
namespace World::Manager
|
|
|
|
{
|
|
|
|
class DebugCommandMgr;
|
|
|
|
}
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
class DebugCommand
|
|
|
|
{
|
|
|
|
public:
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2018-12-22 22:25:03 +01:00
|
|
|
using pFunc = void ( World::Manager::DebugCommandMgr::* )( char*, Entity::Player&, std::shared_ptr< DebugCommand > );
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
// String for the command
|
|
|
|
std::string m_commandName;
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
// command callback
|
|
|
|
pFunc m_pFunc;
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
// helptext
|
|
|
|
std::string m_helpText;
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
// userlevel needed to execute the command
|
|
|
|
uint8_t m_gmLevel;
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2018-10-28 21:53:21 +01: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
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
~DebugCommand()
|
|
|
|
{
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
}
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
const std::string& getName() const
|
|
|
|
{
|
|
|
|
return m_commandName;
|
|
|
|
}
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
const std::string& getHelpText() const
|
|
|
|
{
|
|
|
|
return m_helpText;
|
|
|
|
}
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
uint8_t getRequiredGmLevel() const
|
|
|
|
{
|
|
|
|
return m_gmLevel;
|
|
|
|
}
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
};
|
2017-08-08 13:53:47 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|