-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRestaurantManager.h
More file actions
76 lines (58 loc) · 2.71 KB
/
RestaurantManager.h
File metadata and controls
76 lines (58 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef RESTAURANT_MANAGER_H
#define RESTAURANT_MANAGER_H
#include <vector>
#include <conio.h>
#include "CustomerEntity.h"
#include "VIPCustomer.h"
#include "SeniorCustomer.h"
#include "PrincessCustomer.h"
#include "Player.h"
#include "Report.h"
#include <SFML/System/Clock.hpp>
#include "Shop.h"
#include "Scrap.h"
class RestaurantManager {
private:
std::vector<Scrap> scraps; // Vector to hold scrap objects, representing various discarded items in the restaurant
std::vector<CustomerEntity*> customers; // Vector to store pointers to customers present in the level
// Polymorphism is demonstrated here: the vector holds pointers to base class type CustomerEntity,
// but can point to objects of derived classes like SeniorCustomer, VIPCustomer, PrincessCustomer etc.
Player* player; // Pointer to the player instance, used to manage player interactions and state
Enemy enemy; // Instance of the enemy, initialized in each level
int currentLevel; // Integer to track the current level of the game
sf::Clock enemySpawnClock; // Clock to track time since level start to determine when to spawn the enemy
bool enemySpawned; // Boolean to track if the enemy has already been spawned in the current level
Report* currentReport; // Pointer to a Report object, used to record player and customer stats for each level
public:
// Default constructor
RestaurantManager();
// Method to initialize level 1
void initializeLevel1();
// Method to initialize level 2
void initializeLevel2();
// Method to initialize level 3
void initializeLevel3();
// Getter for the customer list
const std::vector<CustomerEntity*>& getCustomers() const;
// Getter for the player instance
Player* getPlayer() const;
// Getter for the enemy instance
const Enemy& getEnemy() const;
// Getter for the scraps vector, allowing external access to scrap objects
std::vector<Scrap>& getScraps();
// Getter for checking if the enemy has been spawned
bool isEnemySpawned() const;
// Updates the game state, spawns the enemy if 10 seconds have passed
void update();
// Check if all customers have finished their meals
bool allCustomersFinished(std::vector<CustomerEntity*>& customers);
// Checks if the level is complete and displays/saves report if completed
void checkLevelCompletion(sf::RenderWindow& window, std::vector<CustomerEntity*>& customers);
// Checks if the level is complete by verifying all customers have finished meals
bool isLevelComplete();
// Sets up a specific level, clearing old data and initializing a new report and level setup
void setCurrentLevel(int level);
// Destructor
~RestaurantManager();
};
#endif