Skip to content

Commit

Permalink
prepare to merge part 2
Browse files Browse the repository at this point in the history
more bug fixes
  • Loading branch information
willyoung366 committed Dec 2, 2024
1 parent 28b12fe commit 420a535
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,22 @@ public class MinesweeperController extends ElementController {
final int numberData = current.data();
switch (event.getButton()) { //git?
case MouseEvent.BUTTON1:
if(numberData >= 0 && numberData <= 8) {

if(numberData >= 1 && numberData <= 8) {
return MinesweeperTileData.fromData(numberData);
}
if(numberData == 0) {
return MinesweeperTileData.fromData(-2);
}
return MinesweeperTileData.fromData(numberData + 1);

case MouseEvent.BUTTON2, MouseEvent.BUTTON3:
if(numberData >= 1 && numberData <= 8) {
return MinesweeperTileData.fromData(numberData);
}
if(numberData == -2) {
return MinesweeperTileData.fromData(0);
}
return MinesweeperTileData.fromData(numberData - 1);
default:
return MinesweeperTileData.empty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class MinesweeperView extends GridBoardView {
Objects.requireNonNull(
ClassLoader.getSystemClassLoader()
.getResource(
"edu/rpi/legup/images/minesweeper/tiles/Bomb.png")));
"edu/rpi/legup/images/minesweeper/tiles/Mine.png")));
} catch (IOException e) {
LOGGER.error("Failed to open Minesweeper images");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ public MineTile() {
"MINE-UNPL-0001",
"Mine",
"A mine",
"edu/rpi/legup/images/minesweeper/tiles/mine.png");
"edu/rpi/legup/images/minesweeper/tiles/Mine.png");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ public NumberTile() {
"MINE-PLAC-0001",
"Number",
"A number",
"edu/rpi/legup/images/nurikabe/tiles/BlackTile.png");
"edu/rpi/legup/images/minesweeper/tiles/Unset.png");
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 420a535

Please sign in to comment.