summaryrefslogtreecommitdiff
path: root/core/src/Model/Items.cpp
blob: db2d39f77cf44eed139a2844d2cd3c56e5c92151 (plain)
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#include "Items.hpp"

#include <limits>
#include <utility>

ItemBase::ItemBase()
	: mId{ std::numeric_limits<size_t>::max() } {
}

ItemBase::ItemBase(size_t id)
	: mId{ id } {
}

bool ItemBase::IsInvalid() const {
	return mId == std::numeric_limits<size_t>::max();
}

size_t ItemBase::GetId() const {
	return mId;
}

ProductItem::ProductItem(size_t id, std::string name)
	: ItemBase(id)
	, mName{ std::move(name) } {
}

const std::string& ProductItem::GetName() const {
	return mName;
}

void ProductItem::SetName(std::string name) {
	mName = std::move(name);
}

const std::string& ProductItem::GetDescription() const {
	return mDescription;
}

void ProductItem::SetDescription(std::string description) {
	mDescription = std::move(description);
}

FactoryItem::FactoryItem(size_t id, std::string name)
	: ItemBase(id)
	, mName{ std::move(name) } {
}

const std::string& FactoryItem::GetName() const {
	return mName;
}

void FactoryItem::SetName(std::string name) {
	mName = std::move(name);
}

const std::string& FactoryItem::GetDescription() const {
	return mDescription;
}

void FactoryItem::SetDescription(std::string description) {
	mDescription = std::move(description);
}

CustomerItem::CustomerItem(size_t id, std::string name)
	: ItemBase(id)
	, mName{ std::move(name) } {
}

const std::string& CustomerItem::GetName() const {
	return mName;
}

void CustomerItem::SetName(std::string name) {
	mName = std::move(name);
}

const std::string& CustomerItem::GetDescription() const {
	return mDescription;
}

void CustomerItem::SetDescription(std::string description) {
	mDescription = std::move(description);
}