Concrete invoker class that manages monthly government routines. More...
#include <Routines.h>
Public Member Functions | |
| MonthlyRoutines (CityGrowth *cg) | |
| Constructs a MonthlyRoutines object. | |
| void | addtransportRoutines (GovernmentCommands *command) |
| Adds a transport routine command to the list. | |
| void | addbuildingRoutines (GovernmentCommands *command) |
| Adds a building routine command to the list. | |
| void | executueTransport () |
| Executes all transport routines. | |
| void | executueBuilding () |
| Executes all building routines. | |
| void | execute () |
| Executes the monthly routines. | |
Public Member Functions inherited from GovernmentCommands | |
| virtual | ~GovernmentCommands () |
| Virtual destructor for proper cleanup of derived classes. | |
Protected Attributes | |
| CityGrowth * | citygrowth |
| Pointer to the CityGrowth object for city management. | |
Concrete invoker class that manages monthly government routines.
This class manages the execution of various transport and building routines for the city. It holds a reference to the CityGrowth object and maintains lists of commands to be executed.
| MonthlyRoutines::MonthlyRoutines | ( | CityGrowth * | cg | ) |
Constructs a MonthlyRoutines object.
| cg | Pointer to the CityGrowth object. |
| void MonthlyRoutines::addbuildingRoutines | ( | GovernmentCommands * | command | ) |
Adds a building routine command to the list.
| command | Pointer to a GovernmentCommands object representing the building command. |
| void MonthlyRoutines::addtransportRoutines | ( | GovernmentCommands * | command | ) |
Adds a transport routine command to the list.
| command | Pointer to a GovernmentCommands object representing the transport command. |
|
virtual |
Executes the monthly routines.
This function executes both transport and building routines as part of the monthly routines.
Implements GovernmentCommands.
| void MonthlyRoutines::executueBuilding | ( | ) |
Executes all building routines.
This function iterates over the building routines and executes each command.
| void MonthlyRoutines::executueTransport | ( | ) |
Executes all transport routines.
This function iterates over the transport routines and executes each command.