Sensovery Company / Rectangle

Dependents:   Objet Telecommande_prologue

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "Rectangle.h"
00003 
00004 
00005 Rectangle :: Rectangle(int x,int y, int x2, int y2, int color,int * back_c){
00006      Origin['x'] = x;
00007      Origin['y'] = y;
00008      End['x'] = x2;
00009      End['y'] = y2;
00010      back = back_c;
00011     }
00012 
00013 bool Rectangle :: is_touch(int x_touch , int y_touch){
00014     if(x_touch >= Origin['x'] && x_touch <= End['x']) // Si dans l'objet en x
00015         if(y_touch >= Origin['y'] && y_touch <= End['y']) // Et si dans l'objet en y
00016             return true;
00017     return false;
00018     }
00019     
00020 bool Rectangle :: deplace(int x, int y){
00021     }
00022     
00023 int Rectangle :: getX1(){
00024     return Origin['x'];
00025     }
00026     
00027 int Rectangle :: getX2(){
00028     return End['x'];
00029     }
00030     
00031 int Rectangle :: getY1(){
00032     return Origin['y'];
00033     }
00034     
00035 int Rectangle :: getY2(){
00036     return End['y'];
00037     }
00038     
00039 int *  Rectangle :: getBack(){
00040     return back;
00041     }