ECE2035 Project 2

Dependencies:   mbed mbed-rtos SDFileSystem

Committer:
kwengryn3
Date:
Tue Apr 20 18:15:22 2021 +0000
Revision:
10:1994adcfc86f
Parent:
9:f1d34ef049c5
adv features

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 5:b9b7993823e1 16 boundingBox box;
kwengryn3 0:bff8b9020128 17 int width; ///< The width of the compost. The shape of the compost is a rectangle.
kwengryn3 0:bff8b9020128 18 int height; ///< The height of the compost
kwengryn3 0:bff8b9020128 19 } COMPOST;
kwengryn3 0:bff8b9020128 20
kwengryn3 0:bff8b9020128 21 #define MAX_NUM_COMPOST_PILES 11
kwengryn3 0:bff8b9020128 22
kwengryn3 0:bff8b9020128 23 /** Call compost_pile_init() only once at the begining of your code
kwengryn3 0:bff8b9020128 24 Initialize every compost entry in the compost_record array, and also variable tallest_pile_height.
kwengryn3 0:bff8b9020128 25 These two things are defined in the compost_pile.cpp
kwengryn3 0:bff8b9020128 26 */
kwengryn3 0:bff8b9020128 27 void compost_pile_init();
kwengryn3 0:bff8b9020128 28
kwengryn3 0:bff8b9020128 29 /** Get the information of compost
kwengryn3 0:bff8b9020128 30 @param index The index in compost_record. It must be smaller than MAX_NUM_COMPOST_PILES.
kwengryn3 0:bff8b9020128 31 @return The structure of compost information
kwengryn3 0:bff8b9020128 32 */
kwengryn3 5:b9b7993823e1 33 COMPOST compost_get_info(int index);
kwengryn3 0:bff8b9020128 34
kwengryn3 0:bff8b9020128 35 /** Make a pile of compost one unit taller
kwengryn3 0:bff8b9020128 36 @param index The index in compost_record. It must be smaller than MAX_NUM_COMPOST_PILES.
kwengryn3 0:bff8b9020128 37 */
kwengryn3 0:bff8b9020128 38 void compost_add(int index);
kwengryn3 0:bff8b9020128 39
kwengryn3 0:bff8b9020128 40 /** Draw all existing piles onto the screen (Iterate through the compost_record array)
kwengryn3 0:bff8b9020128 41 @brief You might not need to use this function, but you could still use it if you want.
kwengryn3 0:bff8b9020128 42 */
kwengryn3 0:bff8b9020128 43 void draw_compost(void);
kwengryn3 0:bff8b9020128 44
kwengryn3 0:bff8b9020128 45 /** Get height of tallest compost pile
kwengryn3 0:bff8b9020128 46 @brief You will need this function to determine the end of the game
kwengryn3 0:bff8b9020128 47 @return height of tallest compost pile as an int
kwengryn3 0:bff8b9020128 48 */
kwengryn3 0:bff8b9020128 49 int get_compost_tallest_height(void);
kwengryn3 0:bff8b9020128 50
kwengryn3 0:bff8b9020128 51 /** Get height of compost pile at given index
kwengryn3 0:bff8b9020128 52 @brief You will need this function to add fruits to compost
kwengryn3 0:bff8b9020128 53 @return height of tallest compost pile as an int
kwengryn3 0:bff8b9020128 54 */
kwengryn3 0:bff8b9020128 55 int get_compost_height(int index);
kwengryn3 0:bff8b9020128 56
kwengryn3 9:f1d34ef049c5 57 void remove_tallest_pile();
kwengryn3 9:f1d34ef049c5 58
kwengryn3 5:b9b7993823e1 59 int get_num_piles();
kwengryn3 5:b9b7993823e1 60
kwengryn3 5:b9b7993823e1 61 bool check_overflow();
kwengryn3 5:b9b7993823e1 62
kwengryn3 0:bff8b9020128 63 #endif //COMPOST_PILE_PUBLIC_H