-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathServingHatch.cpp
More file actions
27 lines (22 loc) · 929 Bytes
/
ServingHatch.cpp
File metadata and controls
27 lines (22 loc) · 929 Bytes
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
#include "ServingHatch.h"
// ServingHatch class represents an area within the game where food is rendered.
// It visually renders a rectangle shape on the screen to indicate the serving hatch.
//Default Constructor
ServingHatch::ServingHatch()
: rectangle() { // Initialize the rectangle to default values
rectangle.setSize(sf::Vector2f(100.0f, 100.0f)); // Default size
rectangle.setPosition(0.0f, 0.0f); // Default position
rectangle.setFillColor(sf::Color(88, 57, 39)); // Default color
}
// Overloaded Constructor
ServingHatch::ServingHatch(float x, float y, float width, float height) {
rectangle.setSize(sf::Vector2f(width, height));
rectangle.setPosition(x, y);
rectangle.setFillColor(sf::Color(88, 57, 39));
}
// Method to draw the Serving Hatch on the window
void ServingHatch::draw(sf::RenderWindow& window) {
window.draw(rectangle);
}
// Destructor
ServingHatch::~ServingHatch() {}