Base class that represents a move command. A move command has a name and the command character that represents the command in the initial string of movement commands. More...
Public Member Functions | |
MoveCommand (string command, string commandName) | |
Constructor. | |
void | Show () |
Display the move command and its name followed by a newline. | |
abstract void | Execute () |
Execute the command. Derived classes must implement this. | |
Properties | |
string | Name [get, private set] |
Name of the command (assigned in the class constructor). | |
string | Command [get, private set] |
The command character from the original list of commands. Used when displaying the commands as opposed to when executing the commands (assigned in the class constructor). | |
Base class that represents a move command. A move command has a name and the command character that represents the command in the initial string of movement commands.
Yes, this is a variation of the Command Pattern.
In this example, a move command, when executed, prints "move xxx" on the current line. When displayed, the move command shows the command character followed by the name of the command.
Definition at line 24 of file Null_Object.cs.
|
inline |
Constructor.
command | The character that represents the command in the original move list. |
commandName | The name of the command (for display purposes). |
Definition at line 44 of file Null_Object.cs.
References MoveCommand.Name.
|
pure virtual |
Execute the command. Derived classes must implement this.
Implemented in MoveCommandLeft, MoveCommandRight, MoveCommandUp, MoveCommandDown, and MoveCommandNone.
|
inline |
Display the move command and its name followed by a newline.
Definition at line 54 of file Null_Object.cs.
References MoveCommand.Name.
|
getprivate set |
The command character from the original list of commands. Used when displaying the commands as opposed to when executing the commands (assigned in the class constructor).
Definition at line 36 of file Null_Object.cs.
|
getprivate set |
Name of the command (assigned in the class constructor).
Definition at line 29 of file Null_Object.cs.
Referenced by MoveCommand.MoveCommand(), Visitor_Shop.PickupOrder(), Visitor_Shop.PlaceOrder(), MoveCommand.Show(), and EntryInformation.ToString().