-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathItem.h
54 lines (40 loc) · 1.34 KB
/
Item.h
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
#pragma once
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
// Declaration of the toLowerCase function
string toLowerCase(const string& str);
class Item
{
private:
// Member variables
string name; // Item name (stored in lowercase)
string description; // Item description
string imagePath; // Path to a photo
string category = "[None]"; // Default category
int amount; // Item quantity
public:
// Constructor
Item(const string& itemName, const string& itemDescription, int itemAmount, const string& itemImagePath);
// Setter and getter for name
void setName(const string& itemName);
string getName() const;
// Setter and getter for description
void setDescription(const string& itemDescription);
string getDescription() const;
// Setter and getter for image path
void setImage(const string& itemImagePath);
string getImage() const;
// Setter and getter for category
void setCategory(const string& itemCategory);
string getCategory() const;
// Setter and getter for amount
void setAmount(int itemAmount);
int getAmount() const;
// Increment and decrement item quantity
void increment();
void decrement();
// Equality operator
bool operator==(const Item& other) const;
};