Mini projet LOO

Dependencies:   mbed APDS_9960 mbed-rtos

Dependents:   MoveYourTetris_OK

Home du projet

Committer:
Willheisen
Date:
Sun Apr 24 22:11:55 2016 +0000
Revision:
40:08490d120ec4
Parent:
36:f58a566595ad
VERSION FINALE

Who changed what in which revision?

UserRevisionLine numberNew contents of line
clementdoreau 0:b2acac6abf2b 1 #ifndef CFORME_H
clementdoreau 0:b2acac6abf2b 2 #define CFORME_H
clementdoreau 0:b2acac6abf2b 3
clementdoreau 1:ab5f440f4156 4 #include "cLed.h"
clementdoreau 1:ab5f440f4156 5
Willheisen 36:f58a566595ad 6 // Définition de la classe cForme
Willheisen 36:f58a566595ad 7 // Classe qui définit les caractéristiques d'une pièce
Willheisen 36:f58a566595ad 8
clementdoreau 7:4b283e36b147 9 class cForme {
clementdoreau 0:b2acac6abf2b 10
clementdoreau 0:b2acac6abf2b 11 protected:
clementdoreau 7:4b283e36b147 12 unsigned char _orientation; // 4 orientations : rotation de 90° --> de 1 à 4
Willheisen 36:f58a566595ad 13 //Position actuelle du point de référence:
Willheisen 36:f58a566595ad 14 //C'est l'axe de la pièce pour les rotations
clementdoreau 7:4b283e36b147 15 unsigned char _positionX;
clementdoreau 7:4b283e36b147 16 unsigned char _positionY;
Willheisen 36:f58a566595ad 17 //Ancienne position du point de référence
clementdoreau 10:9ef3f520ff6c 18 unsigned char _oldPositionX;
clementdoreau 10:9ef3f520ff6c 19 unsigned char _oldPositionY;
Willheisen 11:c37922a0a915 20 unsigned char _typeForme;//0=ligne, 1=carré, 2=Z, 3=T, 4=L
Willheisen 36:f58a566595ad 21 //Toute forme est composée de 4 LEDs
clementdoreau 7:4b283e36b147 22 cLed _Leds[4]; // LEDS
clementdoreau 0:b2acac6abf2b 23 private:
clementdoreau 0:b2acac6abf2b 24
clementdoreau 0:b2acac6abf2b 25 public:
clementdoreau 7:4b283e36b147 26 // CONSTRUCTEURS
clementdoreau 7:4b283e36b147 27 cForme();
clementdoreau 7:4b283e36b147 28 // DESTRUCTEURS
clementdoreau 7:4b283e36b147 29 virtual ~cForme();
clementdoreau 7:4b283e36b147 30 // GETTERS
clementdoreau 7:4b283e36b147 31 unsigned char getOrientation();
clementdoreau 7:4b283e36b147 32 unsigned char getPositionX();
clementdoreau 7:4b283e36b147 33 unsigned char getPositionY();
clementdoreau 10:9ef3f520ff6c 34 unsigned char getOldPositionX();
clementdoreau 10:9ef3f520ff6c 35 unsigned char getOldPositionY();
clementdoreau 10:9ef3f520ff6c 36 cLed &getLed(unsigned char i);
Willheisen 11:c37922a0a915 37 //////////////////////////////////////////////
Willheisen 11:c37922a0a915 38 unsigned char getTypeForme();
clementdoreau 7:4b283e36b147 39 // SETTERS
clementdoreau 7:4b283e36b147 40 void setOrientation(unsigned char orientation);
clementdoreau 7:4b283e36b147 41 void setPositionX(unsigned char x);
clementdoreau 7:4b283e36b147 42 void setPositionY(unsigned char y);
clementdoreau 10:9ef3f520ff6c 43 void setOldPositionX(unsigned char);
clementdoreau 10:9ef3f520ff6c 44 void setOldPositionY(unsigned char);
clementdoreau 7:4b283e36b147 45 // METHODES
clementdoreau 7:4b283e36b147 46 void deplacementBas();
clementdoreau 7:4b283e36b147 47 void deplacementDroite();
clementdoreau 7:4b283e36b147 48 void deplacementGauche();
clementdoreau 7:4b283e36b147 49 // METHODES VIRTUELLES
clementdoreau 7:4b283e36b147 50 virtual void rotationHoraire();
clementdoreau 0:b2acac6abf2b 51
clementdoreau 0:b2acac6abf2b 52 };
clementdoreau 0:b2acac6abf2b 53
clementdoreau 0:b2acac6abf2b 54 #endif