Newer
Older
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
#include "gobelet.h"
#include "strategieV2.h"
#include "mediumLevelAction.h"
#include "command.h"
Gobelet::Gobelet(){}
Gobelet::Gobelet(Position position):MediumLevelAction(position){}
Gobelet::~Gobelet(){}
int Gobelet::update()
{
if (status == 0)
{
#ifndef ROBOTHW
qDebug() << "gobelet";
#endif
status++;
}
else if (status == 1)
{
StrategieV2::setCurrentGoal(goalPosition, goBack);
status++;
}
else if (status == 2)
{
if (Command::isNear(goalPosition))
{
StrategieV2::lookAt(goalPosition);
status++;
}
}
else if (status == 3)
{
if (Command::isLookingAt(goalPosition))
{
//recuperer le gobelet
#ifndef ROBOTHW
qDebug() << "On recupere le gobelet";
#endif
status++;
}
}
else if (status <=53 && status > -1)
{
status++;
}
else if (status == 54)
{
status = -1;
}
return status;
}