ECE2035 Project 2

Dependencies:   mbed mbed-rtos SDFileSystem

Committer:
kwengryn3
Date:
Sun Apr 04 11:33:20 2021 -0400
Revision:
0:bff8b9020128
Child:
4:8e15742ebcc6
commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
kwengryn3 0:bff8b9020128 1 // =================================================================
kwengryn3 0:bff8b9020128 2 // The header file is for module "compost pile"
kwengryn3 0:bff8b9020128 3 //
kwengryn3 0:bff8b9020128 4 // Copyright 2020 Georgia Tech. All rights reserved.
kwengryn3 0:bff8b9020128 5 // The materials provided by the instructor in this course are for
kwengryn3 0:bff8b9020128 6 // the use of the students currently enrolled in the course.
kwengryn3 0:bff8b9020128 7 // Copyrighted course materials may not be further disseminated.
kwengryn3 0:bff8b9020128 8 // This file must not be made publicly available anywhere.
kwengryn3 0:bff8b9020128 9 //==================================================================
kwengryn3 0:bff8b9020128 10 /** @file compost_pile_public.h */
kwengryn3 0:bff8b9020128 11 #ifndef COMPOST_PILE_PUBLIC_H
kwengryn3 0:bff8b9020128 12 #define COMPOST_PILE_PUBLIC_H
kwengryn3 0:bff8b9020128 13
kwengryn3 0:bff8b9020128 14 // The structure to store the information of a compost
kwengryn3 0:bff8b9020128 15 typedef struct {
kwengryn3 0:bff8b9020128 16 int x; ///< Bottom-left corner of the compost. x coordinate on the screen.
kwengryn3 0:bff8b9020128 17 int y; ///< Bottom-left corner of the compost. y coordinate on the screen.
kwengryn3 0:bff8b9020128 18 int width; ///< The width of the compost. The shape of the compost is a rectangle.
kwengryn3 0:bff8b9020128 19 int height; ///< The height of the compost
kwengryn3 0:bff8b9020128 20 } COMPOST;
kwengryn3 0:bff8b9020128 21
kwengryn3 0:bff8b9020128 22 #define MAX_NUM_COMPOST_PILES 11
kwengryn3 0:bff8b9020128 23
kwengryn3 0:bff8b9020128 24 /** Call compost_pile_init() only once at the begining of your code
kwengryn3 0:bff8b9020128 25 Initialize every compost entry in the compost_record array, and also variable tallest_pile_height.
kwengryn3 0:bff8b9020128 26 These two things are defined in the compost_pile.cpp
kwengryn3 0:bff8b9020128 27 */
kwengryn3 0:bff8b9020128 28 void compost_pile_init();
kwengryn3 0:bff8b9020128 29
kwengryn3 0:bff8b9020128 30 /** Get the information of compost
kwengryn3 0:bff8b9020128 31 @param index The index in compost_record. It must be smaller than MAX_NUM_COMPOST_PILES.
kwengryn3 0:bff8b9020128 32 @return The structure of compost information
kwengryn3 0:bff8b9020128 33 */
kwengryn3 0:bff8b9020128 34 COMPOST compost_get_info(int index);
kwengryn3 0:bff8b9020128 35
kwengryn3 0:bff8b9020128 36 /** Make a pile of compost one unit taller
kwengryn3 0:bff8b9020128 37 @param index The index in compost_record. It must be smaller than MAX_NUM_COMPOST_PILES.
kwengryn3 0:bff8b9020128 38 */
kwengryn3 0:bff8b9020128 39 void compost_add(int index);
kwengryn3 0:bff8b9020128 40
kwengryn3 0:bff8b9020128 41 /** Draw all existing piles onto the screen (Iterate through the compost_record array)
kwengryn3 0:bff8b9020128 42 @brief You might not need to use this function, but you could still use it if you want.
kwengryn3 0:bff8b9020128 43 */
kwengryn3 0:bff8b9020128 44 void draw_compost(void);
kwengryn3 0:bff8b9020128 45
kwengryn3 0:bff8b9020128 46 /** Get height of tallest compost pile
kwengryn3 0:bff8b9020128 47 @brief You will need this function to determine the end of the game
kwengryn3 0:bff8b9020128 48 @return height of tallest compost pile as an int
kwengryn3 0:bff8b9020128 49 */
kwengryn3 0:bff8b9020128 50 int get_compost_tallest_height(void);
kwengryn3 0:bff8b9020128 51
kwengryn3 0:bff8b9020128 52 /** Get height of compost pile at given index
kwengryn3 0:bff8b9020128 53 @brief You will need this function to add fruits to compost
kwengryn3 0:bff8b9020128 54 @return height of tallest compost pile as an int
kwengryn3 0:bff8b9020128 55 */
kwengryn3 0:bff8b9020128 56 int get_compost_height(int index);
kwengryn3 0:bff8b9020128 57
kwengryn3 0:bff8b9020128 58 #endif //COMPOST_PILE_PUBLIC_H