-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProduction.cpp
More file actions
57 lines (46 loc) · 1.14 KB
/
Copy pathProduction.cpp
File metadata and controls
57 lines (46 loc) · 1.14 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
47
48
49
50
51
52
53
54
55
56
57
#include "Production.h"
#include "VariableSequenceModel.h"
Production::Production(QObject* parent):
QObject(parent),
_name("Untitled"),
_sequence(new VariableSequence()),
_weight(1),
_model(new VariableSequenceModel(_sequence))
{}
Production::Production(VariableSequence* variableSequence, int weight, QObject *parent) :
QObject(parent),
_name("Untitled"),
_sequence(variableSequence),
_weight(weight),
_model(nullptr)
{}
Production::~Production() {
if(_model) delete _model;
if(_sequence) delete _sequence;
}
VariableSequence* Production::getSequence() {
if(_sequence == nullptr) {
_sequence = new VariableSequence();
_name = "Busted!";
}
return _sequence;
}
void Production::setSequence(VariableSequence* sequence) {
this->_sequence = sequence;
}
int Production::getWeight() {
return this->_weight;
}
void Production::setWeight(int weight) {
this->_weight = weight;
}
QString Production::getName() {
return _name;
}
VariableSequenceModel* Production::getVariableSequenceModel() {
if(_model == nullptr) _model = new VariableSequenceModel(getSequence());
return _model;
}
void Production::setName(QString name) {
_name = name;
}