-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPosChart.h
60 lines (51 loc) · 793 Bytes
/
PosChart.h
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
#ifndef POSCHART_H
#define POSCHART_H
#include <algorithm>
#include <vector>
using std::fill_n;
using std::vector;
class PosChart
{
vector<int> loop0;
vector<int> loop1;
vector<int> loop2;
public:
PosChart();
void fillPos(int loop, int row);
const vector<int>& PosChart::getLoop(int loop) const;
};
PosChart::PosChart()
{
//initialize all elements with 0
loop0 = vector<int>(2, 0);
loop1 = vector<int>(12, 0);
loop2 = vector<int>(12, 0);
}
void PosChart::fillPos(int loop, int row)
{
switch (loop)
{
case 0:
loop0[row] = 1;
break;
case 1:
loop1[row] = 1;
break;
case 2:
loop2[row] = 1;
break;
}
}
const vector<int>& PosChart::getLoop(int loop) const
{
switch (loop)
{
case 0:
return loop0;
case 1:
return loop1;
case 2:
return loop2;
}
}
#endif