Design Pattern Examples
Overview of object-oriented design patterns
c/Visitor_Village.h
Go to the documentation of this file.
1
7
8#pragma once
9#ifndef __VISITOR_VILLAGE_H__
10#define __VISITOR_VILLAGE_H__
11
13
14
18typedef struct Village
19{
20 const char* Name;
22 size_t shops_count;
24
25
30void Village_Initialize(Village* village);
31
38void Village_Clear(Village* village);
39
47bool Village_Load(Village* village);
48
59bool Village_VisitShop(Village* village, OrderVisitor* visitor);
60
61#endif // __VISITOR_VILLAGE_H__
Declaration of the OrderVisitor structure and its supporting functions, OrderVisitor_Initialize(),...
void Village_Clear(Village *village)
Clear the specified Village object, releasing any allocated memory associated with the village and it...
bool Village_VisitShop(Village *village, OrderVisitor *visitor)
Visit all shops in the given Village object to find the ingredients specified in the OrderVisitor obj...
bool Village_Load(Village *village)
Set up the specified Village object with all the shops that can be visited.
void Village_Initialize(Village *village)
Initialize the specified Village object.
Represents a visitor used for ordering items from various shops. The user starts with an instance of ...
Represents a collection of shops that can be visited.
const char * Name
Name of the village.
size_t shops_count
Number of shops in the shops list.
Visitor_Shop ** shops
List of shops in this village.
Represents a shop in the village that can be visited.