Mini projet LOO

Dependencies:   mbed APDS_9960 mbed-rtos

Dependents:   MoveYourTetris_OK

Home du projet

src/cForme.cpp

Committer:
Willheisen
Date:
2016-04-06
Revision:
8:92d0c4961a16
Parent:
7:4b283e36b147
Child:
9:6f3d8b714a59

File content as of revision 8:92d0c4961a16:

#include "cForme.h"

cForme::cForme() {

}

cForme::~cForme(){

}
// GETTERS

unsigned char cForme::getOrientation() {
	return _orientation;
}

unsigned char cForme::getPositionX() {
	return _positionX;
}

unsigned char cForme::getPositionY() {
	return _positionY;
}

cLed cForme::getLed(unsigned char i) {
	return _Leds[i];
}

// SETTERS
void cForme::setOrientation(unsigned char orientation) {
	_orientation = orientation;
}

void cForme::setPositionX(unsigned char x) {
	_positionX = x;
}
void cForme::setPositionY(unsigned char y) {
	_positionY = y;
}

// METHODES

//		Description:
//	Décalage d'1 case vers le bas
void cForme::deplacementBas() {
	setPositionY(getPositionY() + 1);
	for (unsigned char i = 0; i < 3; i++) {
		getLed(i).setPositionY(getLed(i).getPositionY() + 1);
	}
}

 //		Description:
 //	Décalage d'1 case vers le bas
 void cForme::deplacementDroite() {
 setPositionX(getPositionX() + 1);
 for (unsigned char i = 0; i < 3; i++) {
 getLed(i).setPositionX(getLed(i).getPositionX() + 1);
 }
 }

 //		Description:
 //	Décalage d'1 case vers le bas
 void cForme::deplacementGauche() {
 setPositionX(getPositionX() - 1);
 for (unsigned char i = 0; i < 3; i++) {
 getLed(i).setPositionX(getLed(i).getPositionX() - 1);
 }
 }

void cForme::rotationHoraire(){}