Design Pattern Examples
Overview of object-oriented design patterns
Village Class Reference

Represents a collection of shops that can be visited. More...

Inheritance diagram for Village:
Inheritance graph
Collaboration diagram for Village:
Collaboration graph

Public Member Functions

void LoadVillage ()
 Load the village.
 
void Accept (Visitor visitor)
 The visitor will call this method on each element it wants to visit.
 
void Accept (Visitor visitor)
 The visitor will call this method on each element it wants to visit.
 

Public Attributes

string Name = string.Empty
 Name of this village.
 

Private Attributes

List< Visitor_Shopshops = new List<Visitor_Shop>()
 List of Visitor_Shop class-derived shops in this village that can be visited.
 

Detailed Description

Represents a collection of shops that can be visited.

This class works as the container of all objects that can be visited. All visits start in this container.

Definition at line 16 of file Visitor_Village.cs.

Member Function Documentation

◆ Accept()

void Accept ( Visitor  visitor)
inline

The visitor will call this method on each element it wants to visit.

Parameters
visitorThe visitor.

Implements ISupportVisitors.

Definition at line 138 of file Visitor_Village.cs.

References Village.shops.

Referenced by Visitor_Shop.PlaceOrder(), and Visitor_Exercise.Run().

◆ LoadVillage()

void LoadVillage ( )
inline

Load the village.

Definition at line 31 of file Visitor_Village.cs.

References Village.Name, and Village.shops.

Referenced by Visitor_Exercise.Run().

Member Data Documentation

◆ Name

string Name = string.Empty

◆ shops

List<Visitor_Shop> shops = new List<Visitor_Shop>()
private

List of Visitor_Shop class-derived shops in this village that can be visited.

Definition at line 26 of file Visitor_Village.cs.

Referenced by Village.Accept(), and Village.LoadVillage().


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