-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShopItem.h
More file actions
46 lines (37 loc) · 1.26 KB
/
ShopItem.h
File metadata and controls
46 lines (37 loc) · 1.26 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
#ifndef SHOPITEM_H
#define SHOPITEM_H
#include <string>
#include <iostream>
#include <SFML/Graphics.hpp>
#include "Player.h"
#include "Enemy.h"
#include "CustomerEntity.h"
#include "VIPCustomer.h"
#include "SeniorCustomer.h"
#include "PrincessCustomer.h"
class ShopItem {
protected:
std::string name;
int cost;
std::string description;
sf::Texture itemTexture; // Texture for item image
sf::Sprite itemSprite; // Sprite to display item image
public:
// Constructor to initialize a shop item
ShopItem(const std::string& itemName, int itemCost, const std::string& itemDescription, const std::string& textureFile);
// Getter for item name
std::string getName() const;
// Getter for item cost
int getCost() const;
// Getter for item description
std::string getDescription() const;
// Draw method to render item image
void draw(sf::RenderWindow& window, float x, float y);
// Virtual function for applying an item's effect on player and enemy
virtual void applyEffect(Player* player, Enemy* enemy);
// Virtual function for applying an item's effect to a customer
virtual void applyCustomerEffect(Player* player, CustomerEntity* customer);
// Virtual destructor
virtual ~ShopItem() = default;
};
#endif