-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScrap.h
More file actions
38 lines (30 loc) · 936 Bytes
/
Scrap.h
File metadata and controls
38 lines (30 loc) · 936 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
28
29
30
31
32
33
34
35
36
37
38
#ifndef SCRAP_H
#define SCRAP_H
#include <SFML/Graphics.hpp>
#include <string>
#include <iostream>
// Struct for ScrapPosition to group x and y coordinates
struct ScrapPosition {
float x;
float y;
};
class Scrap {
private:
std::string name;
sf::RectangleShape shape;
static const sf::Vector2f fixedSize; // Fixed size for all scraps
public:
// Constructor to initialize the scrap with a name and position
Scrap(const std::string& scrapName, const ScrapPosition& position);
// Get the name of the scrap
std::string getName() const;
// Display scrap information in the console
void displayInfo() const;
// Set the position of the scrap's SFML shape
void setPosition(float x, float y);
// Render the scrap on the provided SFML window
void draw(sf::RenderWindow& window) const;
// Get the global bounds of the scrap
sf::FloatRect getGlobalBounds() const;
};
#endif