Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. #ifndef MINESWEEPERBOARD_H
  2. #define MINESWEEPERBOARD_H
  3.  
  4. enum GameMode{DEBUG,EASY,NORMAL,HARD};
  5. enum GameState{RUNNING,FINISHED_WIN,FINISHED_LOSS};
  6.  
  7.  
  8. struct Field
  9. {
  10. bool hasMine;
  11. bool hasFlag;
  12. bool isRevealed;
  13. };
  14.  
  15.  
  16. class MinesweeperBoard
  17. {
  18. Field board[100][100];
  19. int width;
  20. int height;
  21. GameMode mode;
  22. int allMines;
  23. int MineCount;
  24. int x;
  25. int y;
  26. public:
  27. GameState state;
  28. MinesweeperBoard(int height,int width,GameMode mode);
  29. void debug_display()const;
  30.  
  31. int getBoardWidth() const;
  32. int getBoardHeight() const;
  33. int getMineCount() const;
  34. int countMines(int x,int y);
  35. int hasFlag(int x, int y) const;
  36. void toggleFlag(int x, int y);
  37. void revealField(int x, int y);
  38. bool isRevealed(int x, int y) const;
  39. GameState getGameState() const;
  40. char getFieldInfo(int x, int y) const;
  41.  
  42.  
  43. };
  44.  
  45. #endif // MINESWEEPERBOARD_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement