![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
3rd year group project. Electronic and Electrical Engineering. Heriot-Watt University. This is the code for the mbed for the Automatic Little Object Organiser (ALOO).
Dependencies: MCP23017 TCS3472_I2C WattBob_TextLCD mbed
Block.cpp@7:b6e31bfdb2af, 2015-11-16 (annotated)
- Committer:
- dreamselec
- Date:
- Mon Nov 16 18:46:31 2015 +0000
- Revision:
- 7:b6e31bfdb2af
- Parent:
- 6:98fe30430194
- Child:
- 20:4e0f0944f28f
Program building with online compiler.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dreamselec |
6:98fe30430194 | 1 | /* |
dreamselec |
6:98fe30430194 | 2 | * Block.cpp |
dreamselec |
6:98fe30430194 | 3 | * |
dreamselec |
6:98fe30430194 | 4 | * Created on: 16 Nov 2015 |
dreamselec |
6:98fe30430194 | 5 | * Author: chandansiyag |
dreamselec |
6:98fe30430194 | 6 | */ |
dreamselec |
6:98fe30430194 | 7 | |
dreamselec |
6:98fe30430194 | 8 | #include "Block.h" |
dreamselec |
6:98fe30430194 | 9 | |
dreamselec |
6:98fe30430194 | 10 | Colour::Colour(){ |
dreamselec |
6:98fe30430194 | 11 | setRed(0); |
dreamselec |
6:98fe30430194 | 12 | setBlue(0); |
dreamselec |
6:98fe30430194 | 13 | setGreen(0); |
dreamselec |
6:98fe30430194 | 14 | setAlpha(0); |
dreamselec |
6:98fe30430194 | 15 | } |
dreamselec |
6:98fe30430194 | 16 | |
dreamselec |
6:98fe30430194 | 17 | Colour::~Colour(){ |
dreamselec |
6:98fe30430194 | 18 | |
dreamselec |
6:98fe30430194 | 19 | } |
dreamselec |
6:98fe30430194 | 20 | |
dreamselec |
6:98fe30430194 | 21 | Colour::Colour(const Colour& rhs){ |
dreamselec |
6:98fe30430194 | 22 | setRed(rhs.getRed()); |
dreamselec |
6:98fe30430194 | 23 | setBlue(rhs.getBlue()); |
dreamselec |
6:98fe30430194 | 24 | setGreen(rhs.getGreen()); |
dreamselec |
6:98fe30430194 | 25 | setAlpha(rhs.getAlpha()); |
dreamselec |
6:98fe30430194 | 26 | } |
dreamselec | 7:b6e31bfdb2af | 27 | |
dreamselec | 7:b6e31bfdb2af | 28 | Block::Block(){ |
dreamselec | 7:b6e31bfdb2af | 29 | this->size = Small; |
dreamselec | 7:b6e31bfdb2af | 30 | this->minColour = Colour(); |
dreamselec | 7:b6e31bfdb2af | 31 | this->maxColour = Colour(); |
dreamselec | 7:b6e31bfdb2af | 32 | } |
dreamselec | 7:b6e31bfdb2af | 33 | Block::Block(Size size) { |
dreamselec | 7:b6e31bfdb2af | 34 | // TODO Auto-generated constructor stub |
dreamselec | 7:b6e31bfdb2af | 35 | this->size = size; |
dreamselec | 7:b6e31bfdb2af | 36 | this->minColour = Colour(); |
dreamselec | 7:b6e31bfdb2af | 37 | this->maxColour = Colour(); |
dreamselec | 7:b6e31bfdb2af | 38 | } |
dreamselec | 7:b6e31bfdb2af | 39 | |
dreamselec | 7:b6e31bfdb2af | 40 | Block::Block(const Block& rhs){ |
dreamselec | 7:b6e31bfdb2af | 41 | minColour = Colour(rhs.minColour); |
dreamselec | 7:b6e31bfdb2af | 42 | maxColour = Colour(rhs.maxColour); |
dreamselec | 7:b6e31bfdb2af | 43 | size = rhs.size; |
dreamselec | 7:b6e31bfdb2af | 44 | } |
dreamselec | 7:b6e31bfdb2af | 45 | |
dreamselec | 7:b6e31bfdb2af | 46 | Block::~Block() { |
dreamselec | 7:b6e31bfdb2af | 47 | // TODO Auto-generated destructor stub |
dreamselec | 7:b6e31bfdb2af | 48 | } |
dreamselec | 7:b6e31bfdb2af | 49 |