minesweeper.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #ifndef MINESWEEPER_H
  2. #define MINESWEEPER_H
  3. #include <string.h> // memset
  4. #include <inttypes.h> // PRIu8 & SCNu8
  5. #include <furi.h>
  6. #include <furi_hal.h>
  7. #include <input/input.h>
  8. #include <notification/notification_messages.h>
  9. #include <gui/gui.h>
  10. #include <gui/view_dispatcher.h>
  11. #include <gui/scene_manager.h>
  12. #include <gui/modules/loading.h>
  13. #include <gui/modules/dialog_ex.h>
  14. #include <gui/modules/variable_item_list.h>
  15. #include <gui/modules/text_box.h>
  16. #include "scenes/minesweeper_scene.h"
  17. #include "views/start_screen.h"
  18. #include "views/minesweeper_game_screen.h"
  19. #include "helpers/mine_sweeper_storage.h"
  20. #include "minesweeper_redux_icons.h"
  21. #define TAG "Mine Sweeper Application"
  22. // This is a helper struct for the settings view/scene
  23. typedef struct {
  24. uint8_t board_width, board_height, difficulty;
  25. bool ensure_solvable_board;
  26. FuriString* width_str;
  27. FuriString* height_str;
  28. VariableItem* difficulty_item;
  29. VariableItem* width_item;
  30. VariableItem* height_item;
  31. VariableItem* solvable_item;
  32. } MineSweeperAppSettings;
  33. // Main MineSweeperApp
  34. typedef struct MineSweeperApp {
  35. SceneManager* scene_manager;
  36. ViewDispatcher* view_dispatcher;
  37. NotificationApp* notification;
  38. StartScreen* start_screen;
  39. Loading* loading;
  40. MineSweeperGameScreen* game_screen;
  41. DialogEx* menu_screen;
  42. VariableItemList* settings_screen;
  43. DialogEx* confirmation_screen;
  44. TextBox* info_screen;
  45. MineSweeperAppSettings settings_info;
  46. MineSweeperAppSettings t_settings_info;
  47. uint8_t is_settings_changed;
  48. bool ensure_map_solvable;
  49. uint8_t feedback_enabled;
  50. } MineSweeperApp;
  51. // View Id Enumeration
  52. typedef enum {
  53. MineSweeperStartScreenView,
  54. MineSweeperLoadingView,
  55. MineSweeperGameScreenView,
  56. MineSweeperMenuView,
  57. MineSweeperSettingsView,
  58. MineSweeperConfirmationView,
  59. MineSweeperInfoView,
  60. MineSweeperViewCount,
  61. } MineSweeperView;
  62. // Enumerations for hardware states
  63. // Will be used in later implementation
  64. typedef enum {
  65. MineSweeperHapticOff,
  66. MineSweeperHapticOn,
  67. } MineSweeperHapticState;
  68. typedef enum {
  69. MineSweeperSpeakerOff,
  70. MineSweeperSpeakerOn,
  71. } MineSweeperSpeakerState;
  72. typedef enum {
  73. MineSweeperLedOff,
  74. MineSweeperLedOn,
  75. } MineSweeperLedState;
  76. #endif