-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGesture.cpp
41 lines (38 loc) · 880 Bytes
/
Gesture.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
#include "Gesture.h"
#include <string>
/*
Ctor.
The function init the vars.
*/
Gesture::Gesture()
{
for (int i = 0; i < NUM_FINGERS; i++)
{
this->_fingers[i] = "";
}
this->_acceleration = "n";
this->_commandNumber = -1;
}
Gesture::Gesture(string fingers[NUM_FINGERS], int commandNumber, string acceleration)
{
this->_fingers = new string[NUM_FINGERS];
this->_acceleration = acceleration;
this->_commandNumber = commandNumber;
for (int i = 0; i < NUM_FINGERS; i++)
{
this->_fingers[i] = fingers[i];
}
}
Gesture::~Gesture()
{
delete this->_fingers;
}
void Gesture::printGesture()
{
cout << "Acceleration: " << this->_acceleration << endl;
cout << "CommandNumber: " << this->_commandNumber << endl;
for (int i = 0; i < NUM_FINGERS; i++)
{
cout << "finger(" << i+1 << ") - " << this->_fingers[i].c_str() << endl;
}
}