#include <Editor.h>
Public Member Functions | |
Editor (UBSocket *sock) | |
Constructs an Editor with the specified socket. | |
virtual | ~Editor (void) |
Destructor, a noop. | |
virtual void | OnEmptyLine () |
This function is called whenever the user sends an empty line. | |
virtual void | OnLine (const std::string &line) |
This function is called whenever a user sends a line. | |
virtual void | OnFocus () |
This function is called whenever this editor becomes the editor that has the focus. | |
virtual std::string | name ()=0 |
Returns the name of this editor. | |
virtual std::string | prompt () |
Returns the prompt for this editor. | |
virtual std::string | lookup (const std::string &action) |
Returns the full name of a command of the specified action. | |
virtual void | dispatch (const std::string &action, const std::string &argument) |
Dispatches the specified action with the specified argument. | |
virtual bool | canReceiveChannel (mud::ChannelPtr channel) const |
Whether the current editor is capable of receiving messages from the specified channel. | |
virtual bool | supportPrefixes () const |
Whether prefixes should be handled in the current editor. | |
void | Send (const std::string &msg) |
Send a message to the user. | |
void | Sendf (const char *format,...) |
Send a formatted message to the user. | |
void | Disconnect () |
Disconnect the user. | |
Protected Attributes | |
UBSocket * | m_sock |
The socket this Editor is associated with. |
Definition at line 37 of file Editor.h.
virtual Editor::~Editor | ( | void | ) | [virtual] |
Destructor, a noop.
virtual void Editor::OnEmptyLine | ( | ) | [inline, virtual] |
This function is called whenever the user sends an empty line.
Reimplemented in EditorNewAccount, and EditorNewCharacter.
virtual void Editor::OnLine | ( | const std::string & | line | ) | [virtual] |
This function is called whenever a user sends a line.
The default implementation will handle the input and use lookup
to find the matching command. If matched it will dispatch it with the dispatch
functions.
Reimplemented in EditorAccountLogin, EditorBool, EditorNewAccount, EditorNewCharacter, and EditorString.
virtual void Editor::OnFocus | ( | ) | [inline, virtual] |
This function is called whenever this editor becomes the editor that has the focus.
Reimplemented in EditorChannel, EditorChunk, EditorCluster, EditorDetail, and EditorRoom.
virtual std::string Editor::name | ( | ) | [pure virtual] |
Returns the name of this editor.
Implemented in EditorAccount, EditorAccountLogin, EditorArea, EditorBool, EditorChannel, EditorChunk, EditorCluster, EditorColour, EditorCommand, EditorDetail, EditorGrantGroup, EditorMobile, EditorNewAccount, EditorNewCharacter, EditorOLC, EditorOOC, EditorPermission, EditorPlaying, EditorRace, EditorRoom, EditorSector, and EditorString.
virtual std::string Editor::prompt | ( | ) | [virtual] |
Returns the prompt for this editor.
Reimplemented in EditorAccount, EditorArea, EditorChannel, EditorChunk, EditorCluster, EditorColour, EditorCommand, EditorDetail, EditorGrantGroup, EditorMobile, EditorOLC, EditorOOC, EditorPermission, EditorPlaying, EditorRace, EditorRoom, and EditorSector.
virtual std::string Editor::lookup | ( | const std::string & | action | ) | [virtual] |
Returns the full name of a command of the specified action.
Reimplemented in EditorAccount, EditorArea, EditorChannel, EditorChunk, EditorCluster, EditorColour, EditorCommand, EditorDetail, EditorGrantGroup, EditorMobile, EditorOLC, EditorOOC, EditorPermission, EditorPlaying, EditorRace, EditorRoom, EditorSector, and OLCEditor.
virtual void Editor::dispatch | ( | const std::string & | action, | |
const std::string & | argument | |||
) | [inline, virtual] |
Dispatches the specified action with the specified argument.
Reimplemented in EditorAccount, EditorArea, EditorChannel, EditorChunk, EditorCluster, EditorColour, EditorCommand, EditorDetail, EditorGrantGroup, EditorMobile, EditorOLC, EditorOOC, EditorPermission, EditorPlaying, EditorRace, EditorRoom, EditorSector, and OLCEditor.
virtual bool Editor::canReceiveChannel | ( | mud::ChannelPtr | channel | ) | const [virtual] |
Whether the current editor is capable of receiving messages from the specified channel.
Reimplemented in EditorAccountLogin, and EditorNewAccount.
virtual bool Editor::supportPrefixes | ( | ) | const [virtual] |
Whether prefixes should be handled in the current editor.
Reimplemented in EditorAccountLogin, EditorNewAccount, and EditorOOC.
void Editor::Send | ( | const std::string & | msg | ) |
Send a message to the user.
void Editor::Sendf | ( | const char * | format, | |
... | ||||
) |
Send a formatted message to the user.
void Editor::Disconnect | ( | ) |
Disconnect the user.
UBSocket* Editor::m_sock [protected] |