Mini projet LOO
Dependencies: mbed APDS_9960 mbed-rtos
Home du projet
src/cCarre.cpp@8:92d0c4961a16, 2016-04-06 (annotated)
- Committer:
- Willheisen
- Date:
- Wed Apr 06 15:41:24 2016 +0000
- Revision:
- 8:92d0c4961a16
- Parent:
- 7:4b283e36b147
- Child:
- 12:7afdbc7465ac
ajout de la classe cJeu avec les m?thodes initialiser et g?n?ration al?atoire de pi?ce
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
clementdoreau | 2:b3f4a37a2687 | 1 | // Définition de la classe Carré |
clementdoreau | 2:b3f4a37a2687 | 2 | |
clementdoreau | 2:b3f4a37a2687 | 3 | #include "cCarre.h" |
clementdoreau | 2:b3f4a37a2687 | 4 | |
clementdoreau | 7:4b283e36b147 | 5 | cCarre::cCarre() { |
clementdoreau | 7:4b283e36b147 | 6 | // variables à 0 |
clementdoreau | 7:4b283e36b147 | 7 | _positionX = 0; |
clementdoreau | 7:4b283e36b147 | 8 | _positionY = 0; |
clementdoreau | 7:4b283e36b147 | 9 | _orientation = 1; |
clementdoreau | 7:4b283e36b147 | 10 | // Positionnement des leds |
clementdoreau | 7:4b283e36b147 | 11 | // |0|1| |
clementdoreau | 7:4b283e36b147 | 12 | // |2|3| |
clementdoreau | 7:4b283e36b147 | 13 | _Leds[0].setPositionX(_positionX); // Led coin haut gauche |
clementdoreau | 7:4b283e36b147 | 14 | _Leds[0].setPositionY(_positionY); // Led coin haut gauche |
clementdoreau | 7:4b283e36b147 | 15 | _Leds[1].setPositionX(_positionX + 1); // Led coin haut droite |
clementdoreau | 7:4b283e36b147 | 16 | _Leds[1].setPositionY(_positionY); // Led coin haut droite |
clementdoreau | 7:4b283e36b147 | 17 | _Leds[2].setPositionX(_positionX); // Led coin bas gauche |
clementdoreau | 7:4b283e36b147 | 18 | _Leds[2].setPositionY(_positionY + 1); // Led coin bas gauche |
clementdoreau | 7:4b283e36b147 | 19 | _Leds[3].setPositionX(_positionX + 1); // Led coin bas droite |
clementdoreau | 7:4b283e36b147 | 20 | _Leds[3].setPositionY(_positionY + 1); // led coin bas droite |
clementdoreau | 2:b3f4a37a2687 | 21 | |
clementdoreau | 2:b3f4a37a2687 | 22 | } |
clementdoreau | 2:b3f4a37a2687 | 23 | |
clementdoreau | 7:4b283e36b147 | 24 | cCarre::cCarre(unsigned char x, unsigned char y) { |
clementdoreau | 7:4b283e36b147 | 25 | // variables à 0 |
clementdoreau | 7:4b283e36b147 | 26 | _positionX = x; |
clementdoreau | 7:4b283e36b147 | 27 | _positionY = y; |
clementdoreau | 7:4b283e36b147 | 28 | _orientation = 1; |
clementdoreau | 7:4b283e36b147 | 29 | // Positionnement des leds |
clementdoreau | 7:4b283e36b147 | 30 | // |0|1| |
clementdoreau | 7:4b283e36b147 | 31 | // |2|3| |
clementdoreau | 7:4b283e36b147 | 32 | _Leds[0].setPositionX(_positionX); // Led coin haut gauche |
clementdoreau | 7:4b283e36b147 | 33 | _Leds[0].setPositionY(_positionY); // Led coin haut gauche |
clementdoreau | 7:4b283e36b147 | 34 | _Leds[1].setPositionX(_positionX + 1); // Led coin haut droite |
clementdoreau | 7:4b283e36b147 | 35 | _Leds[1].setPositionY(_positionY); // Led coin haut droite |
clementdoreau | 7:4b283e36b147 | 36 | _Leds[2].setPositionX(_positionX); // Led coin bas gauche |
clementdoreau | 7:4b283e36b147 | 37 | _Leds[2].setPositionY(_positionY + 1); // Led coin bas gauche |
clementdoreau | 7:4b283e36b147 | 38 | _Leds[3].setPositionX(_positionX + 1); // Led coin bas droite |
clementdoreau | 7:4b283e36b147 | 39 | _Leds[3].setPositionY(_positionY + 1); // led coin bas droite |
clementdoreau | 2:b3f4a37a2687 | 40 | } |
clementdoreau | 2:b3f4a37a2687 | 41 | |
clementdoreau | 2:b3f4a37a2687 | 42 | |
clementdoreau | 7:4b283e36b147 | 43 | void cCarre::rotationHoraire() { |
clementdoreau | 7:4b283e36b147 | 44 | |
clementdoreau | 7:4b283e36b147 | 45 | } |