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