School Commit Init

This commit is contained in:
2024-08-31 12:07:21 +03:00
commit 0b130ee18c
2801 changed files with 4720552 additions and 0 deletions
+68
View File
@@ -0,0 +1,68 @@
#include "item.h"
Item::Item()
{
this->_name = "";
this->_category = "";
this->_price = 0;
}
Item::Item(std::string name, std::string category, int price)
{
this->_name = name;
this->_category = category;
this->_price = price;
}
Item::Item(std::string name, std::string category, int price, std::vector<std::tuple<int,std::string,int>> offers){
this->_name = name;
this->_category = category;
this->_price = price;
this->_offers = offers;
}
std::string Item::name()
{
return this->_name;
}
std::string Item::category()
{
return this->_category;
}
int Item::price() const
{
return this->_price;
}
std::vector<std::tuple<int,std::string,int>> Item::offers()
{
return this->_offers;
}
void Item::name(std::string name)
{
this->_name = name;
}
void Item::category(std::string category)
{
this->_category = category;
}
void Item::price(int price)
{
this->_price = price;
}
void Item::offers(std::vector<std::tuple<int,std::string,int>> offers)
{
this->_offers = offers;
}
void Item::add_offer(std::tuple<int,std::string,int> offer)
{
this->_offers.push_back(offer);
}