-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathchatCommandDefinitions.h
More file actions
51 lines (46 loc) · 1.38 KB
/
chatCommandDefinitions.h
File metadata and controls
51 lines (46 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/**
chatCommandDefinitions.h
PhantomBot Project
By: Robert F. (Phantom139)
**/
#ifndef _CCMDDEC_H
#define _CCMDDEC_H
//Generic Headers (Don't Touch)
#include "include.h"
#include "CustomCommands/CustomCommands.h"
//Headers to all of your custom commands (Insert the path(s) to your custom command files here)
#include "CustomCommands/ccmd_time.h"
#include "CustomCommands/ccmd_isadmin.h"
#include "CustomCommands/ccmd_adminonly.h"
/*
ChatCommandDecs Class
Handle class which contains and initalizes all of the custom chat command definitions
*/
class ChatCommandDecs {
public:
/* Public Class Methods */
//Constructor
ChatCommandDecs() : initialized(false) { }
//Destructor
~ChatCommandDecs() { }
//Fetch the instance
static ChatCommandDecs &fetchInstance() {
if(managedSingleton<ChatCommandDecs>::instance() == NULL) {
managedSingleton<ChatCommandDecs>::createInstance();
}
return *(managedSingleton<ChatCommandDecs>::instance());
}
//Initalize the instance
void init() {
if(initialized == true) {
return;
}
initialized = true;
CustomCommandManager::fetchInstance().AddCommand("!time", new Command_Time());
CustomCommandManager::fetchInstance().AddCommand("!isadmin", new Command_IsAdmin());
CustomCommandManager::fetchInstance().AddCommand("!adminonly", new Command_AdminOnly());
}
private:
bool initialized;
};
#endif //_CCMDDEC_H