Design Pattern Examples
Overview of object-oriented design patterns
NullObject_MoveCommandList.h
Go to the documentation of this file.
1
7
8#pragma once
9#ifndef __NULLOBJECT_MOVECOMMANDLIST_H__
10#define __NULLOBJECT_MOVECOMMANDLIST_H__
11
12#include <stdbool.h>
13
15
19typedef struct
20{
24
31
37void MoveCommandList_Clear(MoveCommandList* commandList);
38
48bool MoveCommandList_Add(MoveCommandList* commandList, MoveCommand* moveCommand);
49
50#endif // __NULLOBJECT_MOVECOMMANDLIST_H__
51
Declaration of the MoveCommand structure along with the support functions, MoveCommand_Create() and M...
void MoveCommandList_Clear(MoveCommandList *commandList)
Clear the given MoveCommandList, freeing up any allocated resources, so the list can be reused.
void MoveCommandList_Initialize(MoveCommandList *commandList)
Initialize the given MoveCommandList object. This should be the first function called for an uninitia...
bool MoveCommandList_Add(MoveCommandList *commandList, MoveCommand *moveCommand)
Add a given MoveCommand object to the given MoveCommandList object. The MoveCommandList takes ownersh...
Represents a move command. A move command has a name and the command character that represents the co...
Represents a list of MoveCommand objects.
MoveCommand ** commands
Array of pointers to MoveCommand objects.
size_t commands_count
Number of commands in the commands array.