-
Notifications
You must be signed in to change notification settings - Fork 0
/
StraightStepCounter.cpp
62 lines (57 loc) · 1.51 KB
/
StraightStepCounter.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
54
55
56
57
58
59
60
61
62
#include "StraightStepCounter.h"
StraightStepCounter::StraightStepCounter()
{
_ForwardPoint = Point(45, 45);
_StancePoint = Point(50, 60);
_ForwardStancePoint = Point(_ForwardPoint.X, _StancePoint.Z);
}
StepContainer StraightStepCounter::GetStepInfo(int stepNumber)
{
StepContainer result = StepContainer();
if (stepNumber % 3 == 0)
{
if (_Flipped)
{
result.EvenMoveTo = _StancePoint;
result.OddMoveTo = _ForwardPoint;
result.EvenRotation = 0;
result.OddRotation = 15;
}
else
{
result.EvenMoveTo = _ForwardPoint;
result.OddMoveTo = _StancePoint;
result.EvenRotation = 15;
result.OddRotation = 0;
}
}
else if (stepNumber % 3 == 1)
{
if (_Flipped)
{
result.EvenMoveTo = _StancePoint;
result.OddMoveTo = _ForwardStancePoint;
result.EvenRotation = 0;
result.OddRotation = 15;
}
else
{
result.EvenMoveTo = _ForwardStancePoint;
result.OddMoveTo = _StancePoint;
result.EvenRotation = 15;
result.OddRotation = 0;
}
}
else if (stepNumber % 3 == 2)
{
result.EvenMoveTo = _StancePoint;
result.OddMoveTo = _StancePoint;
result.EvenRotation = 0;
result.OddRotation = 0;
}
return result;
}
CounterType StraightStepCounter::GetCounterType()
{
return CounterType::STRAIGHT;
}