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

Method OnRightMouseUp

Applications/Minesweeper/main.cpp:229–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227 }
228
229 void OnRightMouseUp(vector2i_t pos){
230 pos -= fixedBounds.pos;
231 int x = pos.x / 16;
232 int y = pos.y / 16;
233
234 if(x < 0 || x >= mapSize.x || y < 0 || y > mapSize.y) return;
235
236 Tile& tile = tiles[y][x];
237
238 if(!tile.hidden) return; // Only hidden tiles can be flagged
239
240 tile.flagged = !tile.flagged;
241
242 CheckWin();
243 }
244
245 int GetDifficulty(){
246 return difficulty;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected