Design Pattern Examples
Overview of object-oriented design patterns
NullObject_MoveCommand.h
Go to the documentation of this file.
1
6
7#pragma once
8#ifndef __NULLOBJECT_MOVECOMMAND_H__
9#define __NULLOBJECT_MOVECOMMAND_H__
10
14typedef void (*ExecuteFunction)(void);
15
16
28typedef struct
29{
31 const char* commandName;
34
35
46MoveCommand* MoveCommand_Create(char commandToken, const char* commandName, ExecuteFunction executeFunction);
47
53void MoveCommand_Destroy(MoveCommand* moveCommand);
54
55#endif // __NULLOBJECT_MOVECOMMAND_H__
void MoveCommand_Destroy(MoveCommand *moveCommand)
Destroy the specified MoveCommand object. After this function returns, the pointer to the MoveCommand...
void(* ExecuteFunction)(void)
Alias for a function that executes a move command.
MoveCommand * MoveCommand_Create(char commandToken, const char *commandName, ExecuteFunction executeFunction)
Create a MoveCommand object and initialize it with the given arguments.
Represents a move command. A move command has a name and the command character that represents the co...
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)