Missile Control Game with uLCD
Dependencies: 4DGL-uLCD-SE SDFileSystem mbed wave_player
Fork of missile_command by
city_landscape/city_landscape_public.h@2:eba4ed0263a4, 2015-10-20 (annotated)
- Committer:
- ajindia6
- Date:
- Tue Oct 20 19:13:03 2015 +0000
- Revision:
- 2:eba4ed0263a4
- Parent:
- 1:3da29f1d84b4
Mbed Mission Control Game
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
arvahsu | 0:532cb55d6136 | 1 | #ifndef CITY_LANDSCAPE_PUBLIC_H |
arvahsu | 0:532cb55d6136 | 2 | #define CITY_LANDSCAPE_PUBLIC_H |
arvahsu | 0:532cb55d6136 | 3 | |
arvahsu | 0:532cb55d6136 | 4 | /// The enum define the status of a city |
arvahsu | 0:532cb55d6136 | 5 | typedef enum { |
arvahsu | 0:532cb55d6136 | 6 | EXIST=1, ///< The city will be shown on screen |
arvahsu | 1:3da29f1d84b4 | 7 | DESTROYED=0 ///< The city won't be shown on screen |
arvahsu | 0:532cb55d6136 | 8 | } CITY_STATUS; |
arvahsu | 0:532cb55d6136 | 9 | |
arvahsu | 0:532cb55d6136 | 10 | /// The structure to store the information of a city |
arvahsu | 0:532cb55d6136 | 11 | typedef struct { |
arvahsu | 0:532cb55d6136 | 12 | int x; ///< Bottom-left corner of the city. x coordinate on the screen. |
arvahsu | 0:532cb55d6136 | 13 | int y; ///< Bottom-left corner of the city. y coordinate on the screen. |
arvahsu | 0:532cb55d6136 | 14 | int width; ///< The width of the city. The shape of the city is an rectangle. |
arvahsu | 0:532cb55d6136 | 15 | int height; ///< The height of the city |
arvahsu | 0:532cb55d6136 | 16 | CITY_STATUS status; ///< See enum CITY_STATUS |
arvahsu | 0:532cb55d6136 | 17 | } CITY; |
arvahsu | 0:532cb55d6136 | 18 | |
arvahsu | 0:532cb55d6136 | 19 | #define MAX_NUM_CITY 6 |
arvahsu | 0:532cb55d6136 | 20 | |
arvahsu | 0:532cb55d6136 | 21 | /** Call city_landscape_init() once at the begining of your code |
arvahsu | 0:532cb55d6136 | 22 | @brief It initialize the city data structure and draw the cities. |
arvahsu | 0:532cb55d6136 | 23 | @param num_city number of city to be draw. It must be less/equal to MAX_NUM_CITY. |
arvahsu | 0:532cb55d6136 | 24 | */ |
arvahsu | 0:532cb55d6136 | 25 | void city_landscape_init(int num_city); |
arvahsu | 0:532cb55d6136 | 26 | |
arvahsu | 0:532cb55d6136 | 27 | /** Get the information of city |
arvahsu | 0:532cb55d6136 | 28 | @param index The index in city_record. It must be smaller than MAX_NUM_CITY. |
arvahsu | 0:532cb55d6136 | 29 | @return The structure of city information |
arvahsu | 0:532cb55d6136 | 30 | */ |
arvahsu | 0:532cb55d6136 | 31 | CITY city_get_info(int index); |
arvahsu | 0:532cb55d6136 | 32 | |
arvahsu | 0:532cb55d6136 | 33 | /** Remove the city from its record and the screen |
arvahsu | 0:532cb55d6136 | 34 | @param index The index in city_record. It must be smaller than MAX_NUM_CITY. |
arvahsu | 0:532cb55d6136 | 35 | */ |
arvahsu | 1:3da29f1d84b4 | 36 | void city_destroy(int index); |
arvahsu | 0:532cb55d6136 | 37 | |
arvahsu | 0:532cb55d6136 | 38 | /** Draw all exist cities on the screen |
arvahsu | 0:532cb55d6136 | 39 | @brief You might not need to use this function, but you could still use it if you want. |
arvahsu | 0:532cb55d6136 | 40 | */ |
arvahsu | 0:532cb55d6136 | 41 | void draw_cities(void); |
arvahsu | 0:532cb55d6136 | 42 | |
arvahsu | 0:532cb55d6136 | 43 | /** Draw the landscape |
arvahsu | 0:532cb55d6136 | 44 | @brief You might not need to use this function, but you could still use it if you want. |
arvahsu | 0:532cb55d6136 | 45 | */ |
arvahsu | 0:532cb55d6136 | 46 | void draw_landscape(void); |
arvahsu | 0:532cb55d6136 | 47 | |
arvahsu | 0:532cb55d6136 | 48 | |
arvahsu | 0:532cb55d6136 | 49 | #endif //CITY_LANDSCAPE_H |