MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / CheckWin

Method CheckWin

Applications/Minesweeper/main.cpp:54–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52 }
53
54 void CheckWin(){
55 unflaggedMines = 0;
56 for(int i = 0; i < mapSize.y; i++){
57 for(int j = 0; j < mapSize.x; j++){
58 Tile& tile = tiles[i][j];
59
60 if(tile.type == MineTile && !tile.flagged){
61 unflaggedMines++;
62 break;
63 }
64 }
65 }
66
67 if(unflaggedMines){
68 return;
69 }
70
71 window->Paint();
72 Lemon::GUI::DisplayMessageBox("Minesweeper", "You Win!");
73
74 Generate(difficulty);
75 }
76public:
77 MinesweeperGame(int diff) : Widget({0,0,0,0}){
78 Generate(diff);

Callers

nothing calls this directly

Calls 3

DisplayMessageBoxFunction · 0.85
GenerateFunction · 0.85
PaintMethod · 0.45

Tested by

no test coverage detected