Setup codebase
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
#include "InventoryItem.h"
|
||||
|
||||
int InventoryItem::m_uid = 0;
|
||||
|
||||
InventoryItem::InventoryItem()
|
||||
: m_id("IIM" + std::to_string(++m_uid)),
|
||||
m_quantity(0),
|
||||
m_price(0.0) {}
|
||||
|
||||
InventoryItem::InventoryItem(const std::string& partName, int quantity, double price)
|
||||
: m_id("IIM" + std::to_string(++m_uid)),
|
||||
m_partName(partName),
|
||||
m_quantity(quantity),
|
||||
m_price(price) {}
|
||||
|
||||
const std::string& InventoryItem::getId() const
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
const std::string& InventoryItem::getPartName() const
|
||||
{
|
||||
return m_partName;
|
||||
}
|
||||
|
||||
int InventoryItem::getQuantity() const
|
||||
{
|
||||
return m_quantity;
|
||||
}
|
||||
|
||||
double InventoryItem::getPrice() const
|
||||
{
|
||||
return m_price;
|
||||
}
|
||||
|
||||
void InventoryItem::setId(const std::string& id)
|
||||
{
|
||||
m_id = id;
|
||||
}
|
||||
|
||||
void InventoryItem::setPartName(const std::string& partName)
|
||||
{
|
||||
m_partName = partName;
|
||||
}
|
||||
|
||||
void InventoryItem::setQuantity(int quantity)
|
||||
{
|
||||
m_quantity = quantity;
|
||||
}
|
||||
|
||||
void InventoryItem::setPrice(double price)
|
||||
{
|
||||
m_price = price;
|
||||
}
|
||||
Reference in New Issue
Block a user