-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
57 lines (52 loc) · 1013 Bytes
/
main.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
#include "Robot.h"
#include "EtatRobot.h"
#include "EtatFige.h"
#include "EtatEnRoute.h"
#include "Afficheur.h"
#include <iostream>
using namespace std;
int main(){
//création du robot
Robot robot;
//création du plot
Plot p(10);
//cration de l'objet
Objet o(20);
//création de l'état
EtatRobot e;
//création de l'afficheur
Afficheur afficheur;
afficheur.setObservable(&robot);
robot.addObserver(&afficheur);
//à vide
robot.avancer(5);
robot.tourner('N');
robot.peser();
//à vide face plot
robot.rencontrerPlot(p);
robot.evaluerPlot();
//à vide
robot.tourner('S');
//à vide face plot
robot.rencontrerPlot(p);
//en charge face plot
robot.saisir(o);
robot.poser();
robot.saisir(o);
//figé
robot.figer();
robot.repartir();
//en charge
robot.tourner('E');
robot.rencontrerPlot(p);
robot.tourner('O');
robot.avancer(5);
robot.tourner('N');
robot.peser();
robot.avancer(10);
robot.repartir();
//en charge face plot
robot.evaluerPlot();
robot.peser();
return 0;
}