obstacles for the map
Column.cpp@1:d55b0553a29a, 2017-05-04 (annotated)
- Committer:
- el15lm
- Date:
- Thu May 04 08:58:34 2017 +0000
- Revision:
- 1:d55b0553a29a
- Parent:
- 0:0c1bbee29dfe
added Doxygen code commenting
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
el15lm | 0:0c1bbee29dfe | 1 | #include "Column.h" |
el15lm | 0:0c1bbee29dfe | 2 | |
el15lm | 0:0c1bbee29dfe | 3 | // Class constructor |
el15lm | 0:0c1bbee29dfe | 4 | Column::Column() |
el15lm | 0:0c1bbee29dfe | 5 | { |
el15lm | 0:0c1bbee29dfe | 6 | |
el15lm | 0:0c1bbee29dfe | 7 | } |
el15lm | 0:0c1bbee29dfe | 8 | |
el15lm | 0:0c1bbee29dfe | 9 | // Class destructor |
el15lm | 0:0c1bbee29dfe | 10 | Column::~Column() |
el15lm | 0:0c1bbee29dfe | 11 | { |
el15lm | 0:0c1bbee29dfe | 12 | |
el15lm | 0:0c1bbee29dfe | 13 | } |
el15lm | 0:0c1bbee29dfe | 14 | |
el15lm | 0:0c1bbee29dfe | 15 | // Initialise the column object |
el15lm | 0:0c1bbee29dfe | 16 | void Column::init(int x, |
el15lm | 0:0c1bbee29dfe | 17 | int y, |
el15lm | 0:0c1bbee29dfe | 18 | int radius) |
el15lm | 0:0c1bbee29dfe | 19 | { |
el15lm | 0:0c1bbee29dfe | 20 | _posX = x; |
el15lm | 0:0c1bbee29dfe | 21 | _posY = y; |
el15lm | 0:0c1bbee29dfe | 22 | _radius = radius; |
el15lm | 0:0c1bbee29dfe | 23 | //pc.printf("a wall has been initialized"); |
el15lm | 0:0c1bbee29dfe | 24 | } |
el15lm | 0:0c1bbee29dfe | 25 | |
el15lm | 0:0c1bbee29dfe | 26 | int Column::getPosX() |
el15lm | 0:0c1bbee29dfe | 27 | { |
el15lm | 0:0c1bbee29dfe | 28 | return _posX; |
el15lm | 0:0c1bbee29dfe | 29 | } |
el15lm | 0:0c1bbee29dfe | 30 | |
el15lm | 0:0c1bbee29dfe | 31 | int Column::getPosY() |
el15lm | 0:0c1bbee29dfe | 32 | { |
el15lm | 0:0c1bbee29dfe | 33 | return _posY; |
el15lm | 0:0c1bbee29dfe | 34 | } |
el15lm | 0:0c1bbee29dfe | 35 | |
el15lm | 0:0c1bbee29dfe | 36 | int Column::getRadius() |
el15lm | 0:0c1bbee29dfe | 37 | { |
el15lm | 0:0c1bbee29dfe | 38 | return _radius; |
el15lm | 0:0c1bbee29dfe | 39 | } |
el15lm | 0:0c1bbee29dfe | 40 | |
el15lm | 0:0c1bbee29dfe | 41 | int Column::getScenePosX() |
el15lm | 0:0c1bbee29dfe | 42 | { |
el15lm | 0:0c1bbee29dfe | 43 | return _scenePosX; |
el15lm | 0:0c1bbee29dfe | 44 | } |
el15lm | 0:0c1bbee29dfe | 45 | |
el15lm | 0:0c1bbee29dfe | 46 | int Column::getScenePosY() |
el15lm | 0:0c1bbee29dfe | 47 | { |
el15lm | 0:0c1bbee29dfe | 48 | return _scenePosY; |
el15lm | 0:0c1bbee29dfe | 49 | } |
el15lm | 0:0c1bbee29dfe | 50 | |
el15lm | 0:0c1bbee29dfe | 51 | void Column::setScenePosX(int x) |
el15lm | 0:0c1bbee29dfe | 52 | { |
el15lm | 0:0c1bbee29dfe | 53 | _scenePosX = x; |
el15lm | 0:0c1bbee29dfe | 54 | } |
el15lm | 0:0c1bbee29dfe | 55 | |
el15lm | 0:0c1bbee29dfe | 56 | void Column::setScenePosY(int y) |
el15lm | 0:0c1bbee29dfe | 57 | { |
el15lm | 0:0c1bbee29dfe | 58 | _scenePosY = y; |
el15lm | 0:0c1bbee29dfe | 59 | } |
el15lm | 0:0c1bbee29dfe | 60 | |
el15lm | 0:0c1bbee29dfe | 61 | // Draw a circle with the dimentions |
el15lm | 0:0c1bbee29dfe | 62 | // given by the inetialiser |
el15lm | 0:0c1bbee29dfe | 63 | void Column::draw(N5110 &lcd) |
el15lm | 0:0c1bbee29dfe | 64 | { |
el15lm | 0:0c1bbee29dfe | 65 | lcd.drawCircle(_scenePosX, _scenePosY, _radius, FILL_BLACK); |
el15lm | 0:0c1bbee29dfe | 66 | //pc.printf("a column has been drawn"); |
el15lm | 0:0c1bbee29dfe | 67 | } |