summaryrefslogtreecommitdiff
path: root/2003/i/buzz/src/automate/receptivite.h
blob: 60f6c0096d9b3fea776c176fbc526ca7b6288ea8 (plain)
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
#ifndef receptivite_h
#define receptivite_h
// receptivite.h
// buzz - Programme du robot Efrei Robotique I1-I2 2003
// Copyright (C) 2003 Nicolas Schodet
#include "expression.h"

namespace Automate
{
    class Receptivite
    {
      public:
        // Destructeur.
	virtual ~Receptivite ();
	// Retourne la valeur de la receptivit�.
	virtual bool test (void) = 0;
    };

    class ReceptiviteBool : public Receptivite
    {
	bool m_bool;
      public:
	// Constructeur.
	ReceptiviteBool (bool _bool) { m_bool = _bool; }
	// Destructeur.
	~ReceptiviteBool ();
	// Retourne la valeur de la receptivit�.
	bool test (void);
    };

    class ReceptiviteBoolOp : public Receptivite
    {
	char m_op;
	Receptivite *m_left, *m_right;
      public:
	// Constructeurs.
	ReceptiviteBoolOp (Receptivite *left, char op, Receptivite *right)
	  { m_left = left; m_op = op; m_right = right; }
	ReceptiviteBoolOp (char op, Receptivite *right)
	  { m_left = 0; m_op = op; m_right = right; }
	// Destructeur.
	~ReceptiviteBoolOp ();
	// Retourne la valeur de la receptivit�.
	bool test (void);
    };

    class ReceptiviteCmpOp : public Receptivite
    {
	char m_op;
	Expression *m_left, *m_right;
      public:
	// Constructeurs.
	ReceptiviteCmpOp (Expression *left, char op, Expression *right)
	  { m_left = left; m_op = op; m_right = right; }
	ReceptiviteCmpOp (char op, Expression *right)
	  { m_left = 0; m_op = op; m_right = right; }
	// Destructeur.
	~ReceptiviteCmpOp ();
	// Retourne la valeur de la receptivit�.
	bool test (void);
    };

    /*Ajout des conditions du grafcet, un objet par condition

    class ReceptInit : public Receptivite
    {
	bool m_bool;
      public:
	// Constructeur.
	ReceptInit (bool _bool) { m_bool = _bool; }
	// Destructeur.
	~ReceptInit ();
	// Retourne la valeur de la receptivit�.
	bool test (void);
    };

    class ReceptPaletsTrouves : public Receptivite
    {
	bool m_bool;
      public:
	// Constructeur.
	ReceptPaletsTrouves (bool _bool) { m_bool = _bool; }
	// Destructeur.
	~ReceptPaletsTrouves ();
	// Retourne la valeur de la receptivit�.
	bool test (void);
    };

    class ReceptPalets : public Receptivite
    {
	bool m_bool;
	int m_nbpalets;
      public:
	// Constructeur.
	ReceptPalets (bool _bool, int _nbpalets) { m_bool = _bool; m_nbpalets = _nbpalets; }
	// Destructeur.
	~ReceptPalets ();
	// Retourne la valeur de la receptivit�.
	bool test (void);
    };

    class ReceptStocke : public Receptivite
    {
	bool m_bool;
	int m_nbstocke;
      public:
	// Constructeur.
	ReceptStocke (bool _bool, int _nbstocke) { m_bool = _bool; _nbstocke = m_nbstocke; }
	// Destructeur.
	~ReceptStocke ();
	// Retourne la valeur de la receptivit�.
	bool test (void);
    };

    class ReceptCouleurAdverse : public Receptivite
    {
	bool m_bool;
	int m_capteur;
      public:
	// Constructeur.
	ReceptCouleurAdverse (bool _bool, int _capteur) { m_bool = _bool; _capteur = m_capteur; }
	// Destructeur.
	~ReceptCouleurAdverse ();
	// Retourne la valeur de la receptivit�.
	bool test (void);
    };

    class ReceptPinceAngle : public Receptivite
    {
	bool m_bool;
	int m_angle;
      public:
	// Constructeur.
	ReceptPinceAngle (bool _bool, int _angle) { m_bool = _bool; m_angle = _angle;}
	// Destructeur.
	~ReceptPinceAngle ();
	// Retourne la valeur de la receptivit�.
	bool test (void);
    };

    class ReceptPincePos : public Receptivite
    {
	bool m_bool;
	int m_position;
      public:
	// Constructeur.
	ReceptPincePos (bool _bool,int _position) { m_bool = _bool; m_position = _position; }
	// Destructeur.
	~ReceptPincePos ();
	// Retourne la valeur de la receptivit�.
	bool test (void);
    };

    class ReceptRobotRecule : public Receptivite
    {
	bool m_bool;
      public:
	// Constructeur
	ReceptRobotRecule (bool _bool) { m_bool = _bool; }
	// Destructeur.
	~ReceptRobotRecule ();
	// Retourne la valeur de la receptivit�.
	bool test (void);
    };

    class ReceptRobotAvance : public Receptivite
    {
	bool m_bool;
      public:
	// Constructeur.
	ReceptRobotAvance (bool _bool) { m_bool = _bool; }
	// Destructeur.
	~ReceptRobotAvance ();
	// Retourne la valeur de la receptivit�.
	bool test (void);
    };

}

#endif // receptivite_h