-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathNode.cpp
53 lines (42 loc) · 873 Bytes
/
Node.cpp
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
/*
* Node.cpp
*
* Created on: Feb 6, 2016
* Author: armin
*/
#include "Node.h"
Node::Node(int index) {
// TODO Auto-generated constructor stub
this->index = index;
this->owner = -1;
this->armyCount = 0;
}
Node::~Node() {
// TODO Auto-generated destructor stub
}
std::vector<Node*>& Node::getNeighbours() {
return this->neighbours;
}
int Node::getIndex() {
return this->index;
}
int Node::getOwner() {
return this->owner;
}
int Node::getArmyCount() {
return this->armyCount;
}
void Node::setNeighbours(const std::vector<Node*>& neighbours) {
this->neighbours.clear();
for(auto &neighbour : neighbours)
this->neighbours.push_back(neighbour);
}
void Node::setOwner(int owner) {
this->owner = owner;
}
void Node::setArmyCount(int armyCount) {
this->armyCount = armyCount;
}
void Node::setIndex(int index) {
this->index = index;
}