-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLHS.cpp
More file actions
61 lines (53 loc) · 1.1 KB
/
LHS.cpp
File metadata and controls
61 lines (53 loc) · 1.1 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
58
59
60
/*
* LHS.cpp
*
* Created on: Jan 29, 2017
* Author: Thomas J. Meehan
*/
#include "LHS.h"
//constructor
LHS::LHS(string n, int v, bool b, vector<string> need, vector<string> used) :
name(n), value(v), solved(b), needed(need), usedBy(used), visited(false) {
}
//default constructor
LHS::LHS() :
name("DEFAULT_NAME"), value(0), solved(false), needed(vector<string>()), usedBy(
vector<string>()), visited(false) {
}
//add new elements to respective vectors
void LHS::addNeed(string s) {
needed.push_back(s);
}
void LHS::addUsed(string s) {
usedBy.push_back(s);
}
//various getters and setters
vector<string> LHS::getNeed() const {
return needed;
}
vector<string> LHS::getUsed() const {
return usedBy;
}
void LHS::updateVals(int val, bool sol, vector<string> pen) {
value = val;
solved = sol;
needed = pen;
}
bool LHS::getVisited() const {
return visited;
}
void LHS::setVisited(bool v) {
visited = v;
}
bool LHS::getSolved() const {
return solved;
}
void LHS::setSolved(bool b) {
solved = b;
}
int LHS::getValue() const {
return value;
}
void LHS::setValue(int given) {
value = given;
}