From 420a535236eff771647450452454d12952e71fa4 Mon Sep 17 00:00:00 2001 From: willyoung366 Date: Sun, 1 Dec 2024 20:24:57 -0500 Subject: [PATCH] prepare to merge part 2 more bug fixes --- .../minesweeper/MinesweeperController.java | 9 ++++++++- .../puzzle/minesweeper/MinesweeperView.java | 2 +- .../puzzle/minesweeper/elements/MineTile.java | 2 +- .../puzzle/minesweeper/elements/NumberTile.java | 2 +- .../minesweeper/tiles/{Bomb.png => Mine.png} | Bin .../rpi/legup/images/minesweeper/tiles/Unset.png | Bin 0 -> 6981 bytes 6 files changed, 11 insertions(+), 4 deletions(-) rename src/main/resources/edu/rpi/legup/images/minesweeper/tiles/{Bomb.png => Mine.png} (100%) create mode 100644 src/main/resources/edu/rpi/legup/images/minesweeper/tiles/Unset.png diff --git a/src/main/java/edu/rpi/legup/puzzle/minesweeper/MinesweeperController.java b/src/main/java/edu/rpi/legup/puzzle/minesweeper/MinesweeperController.java index 3cac9e333..58dd13b49 100644 --- a/src/main/java/edu/rpi/legup/puzzle/minesweeper/MinesweeperController.java +++ b/src/main/java/edu/rpi/legup/puzzle/minesweeper/MinesweeperController.java @@ -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(); diff --git a/src/main/java/edu/rpi/legup/puzzle/minesweeper/MinesweeperView.java b/src/main/java/edu/rpi/legup/puzzle/minesweeper/MinesweeperView.java index 61dc038dc..b80efd7d2 100644 --- a/src/main/java/edu/rpi/legup/puzzle/minesweeper/MinesweeperView.java +++ b/src/main/java/edu/rpi/legup/puzzle/minesweeper/MinesweeperView.java @@ -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"); } diff --git a/src/main/java/edu/rpi/legup/puzzle/minesweeper/elements/MineTile.java b/src/main/java/edu/rpi/legup/puzzle/minesweeper/elements/MineTile.java index 02ae5f46f..66f5ace2d 100644 --- a/src/main/java/edu/rpi/legup/puzzle/minesweeper/elements/MineTile.java +++ b/src/main/java/edu/rpi/legup/puzzle/minesweeper/elements/MineTile.java @@ -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"); } } diff --git a/src/main/java/edu/rpi/legup/puzzle/minesweeper/elements/NumberTile.java b/src/main/java/edu/rpi/legup/puzzle/minesweeper/elements/NumberTile.java index 9ebc13a51..0bf07e9a8 100644 --- a/src/main/java/edu/rpi/legup/puzzle/minesweeper/elements/NumberTile.java +++ b/src/main/java/edu/rpi/legup/puzzle/minesweeper/elements/NumberTile.java @@ -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"); } } diff --git a/src/main/resources/edu/rpi/legup/images/minesweeper/tiles/Bomb.png b/src/main/resources/edu/rpi/legup/images/minesweeper/tiles/Mine.png similarity index 100% rename from src/main/resources/edu/rpi/legup/images/minesweeper/tiles/Bomb.png rename to src/main/resources/edu/rpi/legup/images/minesweeper/tiles/Mine.png diff --git a/src/main/resources/edu/rpi/legup/images/minesweeper/tiles/Unset.png b/src/main/resources/edu/rpi/legup/images/minesweeper/tiles/Unset.png new file mode 100644 index 0000000000000000000000000000000000000000..7e269c7cf4864f6b3fa909f656ad0172f416cf92 GIT binary patch literal 6981 zcmeHMc{o(<`yUdatYs@26Us7XHO53G#*%$W2sN8AWfn7oL7`+TyRuXWiIAh0~le&2uI>-v5F>zwP%Ip?`Q_ve1@&vQS|b)IWt?QPB1i7APJ zK%jM&7N(BC9n8Ph2m`;I;NUsnCPX#1F$RGu6OJr7r1Fg<3r8CeC|VK(iUY1?!0Fg7 z5a?(S2sC~Q1TuUL0x7m}3?l6PG0>~yEIYX;VutKDTJk`3tI^!waQLM z7@i-OPIllDF|d%uq_#@m5gxzO~I*`eCdAA$i@7C7r7LjQ-1p zH8ITwg;$;Wi61t6tg%)#Z;C085l7XY*O4BQsWdwYKchXOKhozcfm#JxZ|N(~a*c&x zq!F>3WnMu>UV~m*h#v5JzE9^RS-dHoZE4jp%#oE@%~ej*9qf5_*7(yaasf+7@GeM0 zJM#hcv1hmAj&By7BlLbal-iXfz7BTx|c%f0nuD`2apxaiNwfb>-Ws z$?`AVN}z*nv4^hCo`RN%g||aN_Xn4VkFlWei$zT3rww(IHiocRLF2mkN z1htYxT6ZarflLkxmxe=GLX6uR7b2vjL|s0m16}!4U!s?~cbpb}i(!urC;nah2H-*Kegb1og(_^nxH(1DaN4J56$&$6kx9p|X zi#G2Tm6DX%9n|Svq@Wd1oEu!E_*n%fniXBPE27iWXYJXj(C8P9Ypjo7u8=8Rz47i^ zAl@;PmwQ=)H-+0H#a}A3)SrVkM{a*PJFT~XF%;Vw@m4BaN?IxJqyl7Z)9R1rc}ctz ziKXTzlf*6x(C~H1J6>rZPqu-X4hrj6yij?AMD|3sNnkr3XTxxvNxbC=mrgbl5drJO& z!5IlQYEf`edNE!If5+mE)p2O0ah_S83DIJtR?W-NsoRoWO)euxz7l=#J_Y5-(}Zfu zYhLOJzN~aP)p3g>r+Yoki552QJT5c7rF-ASLUIMt9mzoYW(sCTAmz#TG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