Dependents:   Objet Telecommande_prologue

main.cpp

Committer:
projetremote
Date:
2011-05-03
Revision:
0:19fca77774b6

File content as of revision 0:19fca77774b6:

#include "mbed.h"
#include "Rectangle.h"


Rectangle :: Rectangle(int x,int y, int x2, int y2, int color,int * back_c){
     Origin['x'] = x;
     Origin['y'] = y;
     End['x'] = x2;
     End['y'] = y2;
     back = back_c;
    }

bool Rectangle :: is_touch(int x_touch , int y_touch){
    if(x_touch >= Origin['x'] && x_touch <= End['x']) // Si dans l'objet en x
        if(y_touch >= Origin['y'] && y_touch <= End['y']) // Et si dans l'objet en y
            return true;
    return false;
    }
    
bool Rectangle :: deplace(int x, int y){
    }
    
int Rectangle :: getX1(){
    return Origin['x'];
    }
    
int Rectangle :: getX2(){
    return End['x'];
    }
    
int Rectangle :: getY1(){
    return Origin['y'];
    }
    
int Rectangle :: getY2(){
    return End['y'];
    }
    
int *  Rectangle :: getBack(){
    return back;
    }