Dependents: Objet Telecommande_prologue
main.cpp@0:19fca77774b6, 2011-05-03 (annotated)
- Committer:
- projetremote
- Date:
- Tue May 03 13:32:04 2011 +0000
- Revision:
- 0:19fca77774b6
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
projetremote | 0:19fca77774b6 | 1 | #include "mbed.h" |
projetremote | 0:19fca77774b6 | 2 | #include "Rectangle.h" |
projetremote | 0:19fca77774b6 | 3 | |
projetremote | 0:19fca77774b6 | 4 | |
projetremote | 0:19fca77774b6 | 5 | Rectangle :: Rectangle(int x,int y, int x2, int y2, int color,int * back_c){ |
projetremote | 0:19fca77774b6 | 6 | Origin['x'] = x; |
projetremote | 0:19fca77774b6 | 7 | Origin['y'] = y; |
projetremote | 0:19fca77774b6 | 8 | End['x'] = x2; |
projetremote | 0:19fca77774b6 | 9 | End['y'] = y2; |
projetremote | 0:19fca77774b6 | 10 | back = back_c; |
projetremote | 0:19fca77774b6 | 11 | } |
projetremote | 0:19fca77774b6 | 12 | |
projetremote | 0:19fca77774b6 | 13 | bool Rectangle :: is_touch(int x_touch , int y_touch){ |
projetremote | 0:19fca77774b6 | 14 | if(x_touch >= Origin['x'] && x_touch <= End['x']) // Si dans l'objet en x |
projetremote | 0:19fca77774b6 | 15 | if(y_touch >= Origin['y'] && y_touch <= End['y']) // Et si dans l'objet en y |
projetremote | 0:19fca77774b6 | 16 | return true; |
projetremote | 0:19fca77774b6 | 17 | return false; |
projetremote | 0:19fca77774b6 | 18 | } |
projetremote | 0:19fca77774b6 | 19 | |
projetremote | 0:19fca77774b6 | 20 | bool Rectangle :: deplace(int x, int y){ |
projetremote | 0:19fca77774b6 | 21 | } |
projetremote | 0:19fca77774b6 | 22 | |
projetremote | 0:19fca77774b6 | 23 | int Rectangle :: getX1(){ |
projetremote | 0:19fca77774b6 | 24 | return Origin['x']; |
projetremote | 0:19fca77774b6 | 25 | } |
projetremote | 0:19fca77774b6 | 26 | |
projetremote | 0:19fca77774b6 | 27 | int Rectangle :: getX2(){ |
projetremote | 0:19fca77774b6 | 28 | return End['x']; |
projetremote | 0:19fca77774b6 | 29 | } |
projetremote | 0:19fca77774b6 | 30 | |
projetremote | 0:19fca77774b6 | 31 | int Rectangle :: getY1(){ |
projetremote | 0:19fca77774b6 | 32 | return Origin['y']; |
projetremote | 0:19fca77774b6 | 33 | } |
projetremote | 0:19fca77774b6 | 34 | |
projetremote | 0:19fca77774b6 | 35 | int Rectangle :: getY2(){ |
projetremote | 0:19fca77774b6 | 36 | return End['y']; |
projetremote | 0:19fca77774b6 | 37 | } |
projetremote | 0:19fca77774b6 | 38 | |
projetremote | 0:19fca77774b6 | 39 | int * Rectangle :: getBack(){ |
projetremote | 0:19fca77774b6 | 40 | return back; |
projetremote | 0:19fca77774b6 | 41 | } |