Design Pattern Examples
Overview of object-oriented design patterns
MoveCommand Struct Reference

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...

#include <NullObject_MoveCommand.h>

Collaboration diagram for MoveCommand:
Collaboration graph

Public Attributes

char commandToken
 The character that represents this move command in a string.
 
const char * commandName
 The name of this move command.
 
ExecuteFunction Execute
 The function to call to execute the move command (this varies for each command)
 

Detailed Description

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. A move command, when displayed, shows the command character followed by the name of the command.

Definition at line 28 of file NullObject_MoveCommand.h.

Member Data Documentation

◆ commandName

const char* commandName

The name of this move command.

Definition at line 31 of file NullObject_MoveCommand.h.

Referenced by _MoveProcessor_ShowMoves(), MoveCommand_Create(), and MoveCommand_Destroy().

◆ commandToken

char commandToken

The character that represents this move command in a string.

Definition at line 30 of file NullObject_MoveCommand.h.

Referenced by _MoveProcessor_ShowMoves(), MoveCommand_Create(), and MoveCommand_Destroy().

◆ Execute

ExecuteFunction Execute

The function to call to execute the move command (this varies for each command)

Definition at line 32 of file NullObject_MoveCommand.h.

Referenced by _MoveProcessor_ExecuteMoves(), MoveCommand_Create(), and MoveCommand_Destroy().


The documentation for this struct was generated from the following file: