-
Notifications
You must be signed in to change notification settings - Fork 0
/
AreaCommand.h
123 lines (96 loc) · 3.2 KB
/
AreaCommand.h
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/**
* @file AreaCommand.h
* AreaCommand.h defines the methods for the AreaCommand.cpp source file.
*
* @brief Defines the AreaCommand class.
*
* @author Michael Abrams
* @author James Boocock
* @author Toby Herbert
* @author Tatai Nikora
* @version 0.3
*/
#ifndef _AREA_COMMAND_H
#define _AREA_COMMAND_H
//------------------------------------------------------------------------------
/* Include */
//------------------------------------------------------------------------------
#include <vector>
#include <string>
class AreaCommand {
protected:
bool locked; ///< Flag, whether this area command is locked.
std::string name; ///< The name of this area command.
std::string status; ///< The status of this area command.
std::string message; ///< The message displayed when area command called.
std::string depends; ///< What the area command depends on.
std::string move_to_area; ///< New area when area command called.
std::vector<std::string> *synonyms; ///< Vector of synonyms for area command.
public:
/**
The constructor for an AreaCommand.
@param[in] callmeby The name of this command.
@param[in] areatomoveto The area to move to when this command is called.
@param[in] status_command The status id to change to.
@param[in] depends_command
@param[in] synonyms A vector containing synonyms of 'callmeby'.
@param[in] locked If true command cannot be called.
*/
AreaCommand(const char * callmeby, const char * areatomoveto, const char * status_command, const char * depends_command, std::vector<std::string> *synonyms, bool locked);
/**
The AreaCommand Destructor
*/
~AreaCommand();
/**
Returns what the AreaCommand depends on.
@return An id of an item the command depends on.
*/
std::string get_depends();
/**
Get the status of the AreaCommand
@return The status of the AreaCommand.
*/
std::string get_status();
/**
Get the name of the AreaCommand.
@return The name of the AreaCommand.
*/
std::string get_name();
/**
Get the name of the area to move to when this command is used.
@return The name of the area to move to.
*/
std::string get_area();
/**
Get the message to print when this command is used.
@return A message to print for this command.
*/
std::string get_message();
/**
Change the message for this command.
@param[in] to_message The new message for this command.
*/
void set_message(const char *to_message);
/**
Compares the name of the command with a string.
@param[in] to_find A string to compare with the command name.
@return True if the strings match otherwise false.
*/
bool find(std::string to_find);
/**
Unlocks the command so it can be called.
*/
void unlock();
/**
Checks whether this area command is locked.
@return True if the command is locked or false if it is unlocked.
*/
bool is_locked();
/**
Checks if the area command has a synonym matching a string.
@param[in] item The name to check
@return True if the synonym list has the string or false if not.
*/
bool has_synonym(std::string item);
};
#endif