Version of Robotron arcade game using LPC1768, a Gameduino shield, a serial EEPROM (for high scores), two microswitch joysticks and two buttons plus a box to put it in. 20 levels of mayhem.
Dependencies: 25LCxxx_SPI CommonTypes Gameduino mbed
Diff: FieldGrid.h
- Revision:
- 15:d8ea0c7b7e64
- Child:
- 16:d0b142ba4362
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/FieldGrid.h Sat Jun 15 15:05:19 2013 +0000 @@ -0,0 +1,61 @@ +/* + * SOURCE FILE : FieldGrid.h + * + * Definition of class FieldGrid. + * This is a grid of rectangles used for fields on a form or whatever. + * + */ + +#ifndef FieldGridDefined + + #define FieldGridDefined + + #include <stdlib.h> // for NULL + #include "Types.h" + #include "FieldRow.h" + + class FieldGrid { + + public : + + /***************/ + /* CONSTRUCTOR */ + /***************/ + // Pass number of rows in grid in rc. + FieldGrid( UInt8 rc ); + + /**************/ + /* DESTRUCTOR */ + /**************/ + virtual ~FieldGrid(); + + /*************/ + /* GET A ROW */ + /*************/ + // Pass row number in rowNum. + // Returns pointer to row or NULL if no such row. + FieldRow *GetRow( UInt8 rowNum ); + + /*****************/ + /* GET ROW COUNT */ + /*****************/ + // Returns number of rows. + UInt8 GetRowCount( void ) const { + return rowCount; + } + + private : + + // Pointer to array of FieldRow objects, one for each row in the grid. + FieldRow *rows; + + // Number of rows. + UInt8 rowCount; + + }; + +#endif + +/* END of FieldGrid.h */ + +