-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboard.cpp
More file actions
28 lines (22 loc) · 985 Bytes
/
board.cpp
File metadata and controls
28 lines (22 loc) · 985 Bytes
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
#include "board.h"
#include "config.h"
Board::Board()
{
}
void Board::setRelation(int pointsPos[][2], int pointNeigh[][4])
{
for (int i = 0; i < MAXPOINTS; i++){ //Create 24 Points in vectPoint QVector with the correct coordonate
vectPoint.append(new Point(i, pointsPos[i][0], pointsPos[i][1]));
}
for (int j = 0; j < MAXPOINTS; j++){ //Set each point neighbour
if (pointNeigh[j][2]==-1 && pointNeigh[j][3]==-1){
vectPoint.at(j)->setNeighbour(vectPoint.at(pointNeigh[j][0]), vectPoint.at(pointNeigh[j][1]), nullptr, nullptr);
}
else if (pointNeigh[j][3]==-1) {
vectPoint.at(j)->setNeighbour(vectPoint.at(pointNeigh[j][0]), vectPoint.at(pointNeigh[j][1]), vectPoint.at(pointNeigh[j][2]), nullptr);
}
else {
vectPoint.at(j)->setNeighbour(vectPoint.at(pointNeigh[j][0]), vectPoint.at(pointNeigh[j][1]), vectPoint.at(pointNeigh[j][2]), vectPoint.at(pointNeigh[j][3]));
}
}
}