-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRestaurant.h
More file actions
137 lines (106 loc) · 4.15 KB
/
Restaurant.h
File metadata and controls
137 lines (106 loc) · 4.15 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#ifndef RESTAURANT_H
#define RESTAURANT_H
#include <SFML/System/Clock.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
#include <vector>
#include <iostream>
#include "Player.h"
#include "Table.h"
#include "WaitingArea.h"
#include "ServingHatch.h"
#include "Food.h"
#include "CustomerEntity.h"
#include "Enemy.h"
#include "RestaurantManager.h"
#include "StepTile.h"
#include "AudioManager.h"
#include "Stack.h"
#include "Scrap.h"
class Restaurant {
private:
sf::Font font; // Font for displaying text
sf::RectangleShape bagButton; // Shape for the bag button
sf::Text bagButtonText; // Text for the bag button
sf::RectangleShape apronButton; // Shape for the apron button
sf::Text apronButtonText; // Text for the apron button
sf::Vector2f apronButtonPosition; // Define the apronButton's position and size
sf::Vector2f apronButtonSize;
sf::Vector2f bagButtonPosition; // Define the bagButton's position and size
sf::Vector2f bagButtonSize;
// Various shopItem instances that can be used in the game
SpeedBoostingKit speedBoostingKit;
Boots boots;
Heels heels;
Butter butter;
Axolotl axolotl;
FortuneCat fortuneCat;
FortunePig fortunePig;
FortuneMask fortuneMask;
ReputationBoostingKit reputationBoostingKit;
Cigarettes cigarettes;
Pearls pearls;
WaterBottle waterBottle;
// AudioManager instance to handle game sounds and music
AudioManager audioManager;
// The SFML RenderWindow object that represents the game window
sf::RenderWindow window;
// Pointer to keep track of currently selected customer
CustomerEntity *selectedCustomer;
// Pointer to keep track of currently selected food
Food *selectedFood;
// Pointer to keep track of currently selected table
Table *selectedTable;
// Represents the waiting area where customers wait to be seated
WaitingArea waitingArea;
// Represents the serving hatch where food is prepared and served to the customers
ServingHatch servingHatch;
// Food objects representing different food types: appetizer, main course, and dessert
Food appetizer, mainCourse, dessert, champagne;
// Vector for tables
std::vector<Table> tables;
// Stores pointers to different derived customer types,
// using the base class pointer (CustomerEntity*) to enable polymorphism at runtime.
std::vector<CustomerEntity*> customers;
// A pointer to the singleton Player object representing the player in the game
Player *player;
// Enemy object
Enemy enemy;
// RestaurantManager object
RestaurantManager restaurantManager;
// Vector for the StepTiles
std::vector<StepTile> stepTiles; // Vector to hold StepTile instances
// Current level of the game
int currentLevel;
// Stack instance for managing cards
Stack cardStack;
// Pointer to the Shop class for managing item purchases
Shop* shop;
public:
// Overloaded Constructor with width and height as unsigned to prevent negative dimensions
Restaurant(unsigned int width, unsigned int height, const std::string &title);
// Main game loop
void run();
// Define this method to check if the player is within the StepTile boundaries, helping in pathing and movement restriction
bool isWithinStepTileBoundaries(const sf::Vector2f& position) const;
// Destructor
~Restaurant();
private: // Intended for internal use only, managing the restaurant's operations
// Function to check if the player collides with any scrap and remove it
void checkPlayerScrapCollision();
// Checks if player collides with a customer
void checkPlayerCustomerCollision();
// Processes all events
void processEvents();
// Updates game state and elements each frame
void update();
// Updates game state and elements each frame
bool checkCollision(const Player& player, const Enemy& enemy);
// Renders the game elements on the screen
void render();
// Handles logic when the player is close to specific objects or characters
void handlePlayerProximity();
// Handles right-click interactions
void handleRightClick(float mouseX, float mouseY);
};
#endif