1 /** An implementation of mineSweeper for use as a hacking minigame.
2  *  Original implementation by https://github.com/daid
3  */
4 
5 #ifndef MINESWEEPER_H
6 #define MINESWEEPER_H
7 
8 #include "miniGame.h"
9 #include "gui/gui2_togglebutton.h"
10 
11 
12 class MineSweeper : public MiniGame {
13   public:
14     MineSweeper(GuiPanel* owner, GuiHackingDialog* parent, int difficulty);
15     virtual void reset() override;
16     virtual void disable() override;
17     virtual float getProgress() override;
18     virtual sf::Vector2f getBoardSize() override;
19   protected:
20     virtual void gameComplete() override;
21   private:
22     void onFieldClick(int x, int y);
23     int error_count;
24     int correct_count;
25     int field_size;
26     int bomb_count;
27     class FieldItem : public GuiToggleButton
28     {
29     public:
30         FieldItem(GuiContainer* owner, string id, string text, func_t func);
31 
32         bool bomb;
33     };
34     FieldItem* getFieldItem(int x, int y);
35 };
36 
37 #endif//MINESWEEPER_H
38