Skip to content

Commit

Permalink
Added difficulty param to alloc and reset function
Browse files Browse the repository at this point in the history
This way the main allocation function for the app and any scenes that need to (like the settings confirmation scene) can reset
the game with the appropraite board dimensions and difficulty
  • Loading branch information
squee72564 committed Jan 2, 2024
1 parent 375505b commit 07bd848
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions views/minesweeper_game_screen.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@

// These defines represent how many tiles
// can be visually representen on the screen
// due to icon sizes
#define MINESWEEPER_SCREEN_TILE_HEIGHT 7
#define MINESWEEPER_SCREEN_TILE_WIDTH 16

#define MINESWEEPER_STARTING_MINES (44)

#ifdef __cplusplus
extern "C" {
#endif
Expand All @@ -36,7 +35,7 @@ typedef bool (*GameScreenInputCallback)(InputEvent* event, void* context);
*
* @return MineSweeperGameScreen view instance
*/
MineSweeperGameScreen* mine_sweeper_game_screen_alloc(uint8_t width, uint8_t height);
MineSweeperGameScreen* mine_sweeper_game_screen_alloc(uint8_t width, uint8_t height, uint8_t difficulty);

/** Deinitialize and free Start Screen view
*
Expand All @@ -48,7 +47,7 @@ void mine_sweeper_game_screen_free(MineSweeperGameScreen* instance);
*
* @param instance MineSweeperGameScreen instance
*/
void mine_sweeper_game_screen_reset(MineSweeperGameScreen* instance, uint8_t width, uint8_t height);
void mine_sweeper_game_screen_reset(MineSweeperGameScreen* instance, uint8_t width, uint8_t height, uint8_t difficulty);

/** Get MineSweeperGameScreen view
*
Expand Down

0 comments on commit 07bd848

Please sign in to comment.