|
|
Command (IRCModule* ircModule, DCCUser* pUser, QString text) |
Construct a new Command object.
PRECONDITIONS: ircModule != 0 ; pUser != 0
Parameters:
ircModule | A pointer to the IRCModule object the command should use to interact with the IRC server. |
pUser | A pointer to the DCCUser object of the user initiating the command. |
text | A string containing the text the user sent (including the command's name and parameters). |
void execute () |
Make the command execute. Subclasses must redefine this method and implement their specific behavior.
void unExecute () |
Cancel the effects of a command, if possible. Subclasses can redefine this method to implement command undoing. This method does nothing by default.
bool hasAccess (unsigned int level) |
Determine if the user pointed to by the _user member has the specified access on his current channel.
Parameters:
level | The minimum level needed to execute the command. |
Returns: true if the user's level on his current channel is equal or higher than level, false otherwise.
bool hasGlobalAccess (unsigned int level) |
Determine if the user pointed to by the _user member has the specified global access (access on channel "*")
Parameters:
level | The minimum level needed to execute the command. |
Returns: true if the user's level on special channel "*" is equal or higher than level, false otherwise.
bool hasEnoughParams (unsigned int min,QString syntax = "") |
Determine if the user specified enough parameters for the command. If the user specified less than min parameters, he is given an error message with the syntax parameter for more details.
Parameters:
min | Minimum necessary number of parameters to the command. |
syntax | A string containing an explanation of the command's syntax. this string is displayed to the user if he did not supply enough parameters. |