From b961f15c4bb74ad72742e32daf3d0a69082e9795 Mon Sep 17 00:00:00 2001 From: Kevin-771 <70790256+Kevin-771@users.noreply.github.com> Date: Tue, 30 Jan 2024 17:00:20 -0500 Subject: [PATCH 01/17] working on an abstract GridRegion class (WIP) added some basic functions to GridRegion --- .../rpi/legup/model/gameboard/GridRegion.java | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/main/java/edu/rpi/legup/model/gameboard/GridRegion.java diff --git a/src/main/java/edu/rpi/legup/model/gameboard/GridRegion.java b/src/main/java/edu/rpi/legup/model/gameboard/GridRegion.java new file mode 100644 index 000000000..233f443b3 --- /dev/null +++ b/src/main/java/edu/rpi/legup/model/gameboard/GridRegion.java @@ -0,0 +1,39 @@ +package edu.rpi.legup.model.gameboard; + +import edu.rpi.legup.model.gameboard.GridCell; + +import java.util.ArrayList; +import java.util.List; + +public abstract class GridRegion { + + protected List regionCells; + + /** + * Region Constructor + */ + public GridRegion() { + this.regionCells = new ArrayList<>(); + } + + public void addCell(GridCell cell) { + regionCells.add(cell); + } + + public void removeCell(GridCell cell) { + regionCells.remove(cell); + } + + public List getCells() { + return regionCells; + } + + public int getSize(){ + return regionCells.size(); + } + + /* + public void colorRegion(){} + */ + +} From d84ad72fa716fff01ef388fa2f91ad44114a9ed1 Mon Sep 17 00:00:00 2001 From: Kevin-771 <70790256+Kevin-771@users.noreply.github.com> Date: Fri, 2 Feb 2024 16:09:46 -0500 Subject: [PATCH 02/17] added comments to GridRegion --- .../rpi/legup/model/gameboard/GridRegion.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/java/edu/rpi/legup/model/gameboard/GridRegion.java b/src/main/java/edu/rpi/legup/model/gameboard/GridRegion.java index 233f443b3..ddf5919e1 100644 --- a/src/main/java/edu/rpi/legup/model/gameboard/GridRegion.java +++ b/src/main/java/edu/rpi/legup/model/gameboard/GridRegion.java @@ -16,18 +16,34 @@ public GridRegion() { this.regionCells = new ArrayList<>(); } + /** + * Adds the cell to the region + * @param cell cell to be added to the region + */ public void addCell(GridCell cell) { regionCells.add(cell); } + /** + * Removes the cell from the region + * @param cell cell to be remove from the region + */ public void removeCell(GridCell cell) { regionCells.remove(cell); } + /** + * Returns the list of cells in the region + * @return list of cells in region + */ public List getCells() { return regionCells; } + /** + * Returns the number of cells in the region + * @return number of cells in the region + */ public int getSize(){ return regionCells.size(); } From 79d3608de68a82105a197adba86e222458427980 Mon Sep 17 00:00:00 2001 From: Kevin-771 <70790256+Kevin-771@users.noreply.github.com> Date: Fri, 2 Feb 2024 16:56:28 -0500 Subject: [PATCH 03/17] modified GridRegion to handle generic types --- .../java/edu/rpi/legup/model/gameboard/GridRegion.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/edu/rpi/legup/model/gameboard/GridRegion.java b/src/main/java/edu/rpi/legup/model/gameboard/GridRegion.java index ddf5919e1..a571c0f1b 100644 --- a/src/main/java/edu/rpi/legup/model/gameboard/GridRegion.java +++ b/src/main/java/edu/rpi/legup/model/gameboard/GridRegion.java @@ -5,9 +5,9 @@ import java.util.ArrayList; import java.util.List; -public abstract class GridRegion { +public abstract class GridRegion { - protected List regionCells; + protected List regionCells; /** * Region Constructor @@ -20,7 +20,7 @@ public GridRegion() { * Adds the cell to the region * @param cell cell to be added to the region */ - public void addCell(GridCell cell) { + public void addCell(T cell) { regionCells.add(cell); } @@ -28,7 +28,7 @@ public void addCell(GridCell cell) { * Removes the cell from the region * @param cell cell to be remove from the region */ - public void removeCell(GridCell cell) { + public void removeCell(T cell) { regionCells.remove(cell); } @@ -36,7 +36,7 @@ public void removeCell(GridCell cell) { * Returns the list of cells in the region * @return list of cells in region */ - public List getCells() { + public List getCells() { return regionCells; } From 2ae701774ea1814819c6ae0aa3705e1c73565702 Mon Sep 17 00:00:00 2001 From: Kevin-771 <70790256+Kevin-771@users.noreply.github.com> Date: Fri, 2 Feb 2024 16:57:35 -0500 Subject: [PATCH 04/17] Update GridRegion.java --- src/main/java/edu/rpi/legup/model/gameboard/GridRegion.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/edu/rpi/legup/model/gameboard/GridRegion.java b/src/main/java/edu/rpi/legup/model/gameboard/GridRegion.java index a571c0f1b..6718ab6f4 100644 --- a/src/main/java/edu/rpi/legup/model/gameboard/GridRegion.java +++ b/src/main/java/edu/rpi/legup/model/gameboard/GridRegion.java @@ -1,7 +1,5 @@ package edu.rpi.legup.model.gameboard; -import edu.rpi.legup.model.gameboard.GridCell; - import java.util.ArrayList; import java.util.List; From b5b73baf78e7ea4002a6785eb4edbdefea6db29e Mon Sep 17 00:00:00 2001 From: Chase-Grajeda Date: Fri, 2 Feb 2024 17:39:10 -0500 Subject: [PATCH 05/17] Added board initialization template Added rippleeffect folder within puzzles so we can begin implementing and rendering the demo puzzle Added RippleEffect.java Added RippleEffectCell.java Added RippleEffectImporter.java Added RippleEffectView.java --- .../puzzle/rippleeffect/RippleEffect.java | 99 +++++++++++++++++++ .../puzzle/rippleeffect/RippleEffectCell.java | 5 + .../rippleeffect/RippleEffectImporter.java | 64 ++++++++++++ .../puzzle/rippleeffect/RippleEffectView.java | 5 + 4 files changed, 173 insertions(+) create mode 100644 src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffect.java create mode 100644 src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectCell.java create mode 100644 src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectImporter.java create mode 100644 src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectView.java diff --git a/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffect.java b/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffect.java new file mode 100644 index 000000000..73efb46eb --- /dev/null +++ b/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffect.java @@ -0,0 +1,99 @@ +package edu.rpi.legup.puzzle.rippleeffect; + +import edu.rpi.legup.model.Puzzle; +import edu.rpi.legup.model.RegisterPuzzle; +import edu.rpi.legup.model.gameboard.Board; +import edu.rpi.legup.model.gameboard.PuzzleElement; +import edu.rpi.legup.model.rules.ContradictionRule; + + +/** + * 1) Number is duplicated in a row or a column, the space between the duplicated numbers must be equal to or larger than the value of the number. + * 2) Each Room contains consecutive numbers starting from 1. + * 3) If a number is duplicated in a row or a column, the space between the duplicated numbers must be equal to or larger than the value of the number. + */ + + + +@RegisterPuzzle +public class RippleEffect extends Puzzle { + + public RippleEffect() { + super(); + this.name = "RippleEffect"; + + // this.importer = new LightUpImporter(this); + // this.exporter = new LightUpExporter(this); + + // this.factory = new LightUpCellFactory(); + } + + /** + * Initializes the game board. Called by the invoker of the class + */ + @Override + public void initializeView() { + // boardView = new LightUpView((LightUpBoard) currentBoard); + // boardView.setBoard(currentBoard); + // addBoardListener(boardView); + } + + /** + * Generates a random edu.rpi.legup.puzzle based on the difficulty + * + * @param difficulty level of difficulty (1-10) + * @return board of the random edu.rpi.legup.puzzle + */ + @Override + public Board generatePuzzle(int difficulty) { + return null; + } + + @Override + /** + * Determines if the given dimensions are valid for Light Up + * + * @param rows the number of rows + * @param columns the number of columns + * @return true if the given dimensions are valid for Light Up, false otherwise + */ + public boolean isValidDimensions(int rows, int columns) { + return rows > 0 && columns > 0; + } + + /** + * Determines if the current board is a valid state + * + * @param board board to check for validity + * @return true if board is valid, false otherwise + */ + @Override + public boolean isBoardComplete(Board board) { + // LightUpBoard lightUpBoard = (LightUpBoard) board; + // lightUpBoard.fillWithLight(); + + // for (ContradictionRule rule : contradictionRules) { + // if (rule.checkContradiction(lightUpBoard) == null) { + // System.out.println(rule.getRuleName()); + // return false; + // } + // } + // for (PuzzleElement data : lightUpBoard.getPuzzleElements()) { + // LightUpCell cell = (LightUpCell) data; + // if ((cell.getType() == LightUpCellType.UNKNOWN || cell.getType() == LightUpCellType.EMPTY) && !cell.isLite()) { + // return false; + // } + // } + return true; + } + + /** + * Callback for when the board puzzleElement changes + * + * @param board the board that has changed + */ + @Override + public void onBoardChange(Board board) { + + } +} diff --git a/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectCell.java b/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectCell.java new file mode 100644 index 000000000..b8a4da825 --- /dev/null +++ b/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectCell.java @@ -0,0 +1,5 @@ +package edu.rpi.legup.puzzle.rippleeffect; + +public class RippleEffectCell { + +} diff --git a/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectImporter.java b/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectImporter.java new file mode 100644 index 000000000..7b3b25bac --- /dev/null +++ b/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectImporter.java @@ -0,0 +1,64 @@ +package edu.rpi.legup.puzzle.rippleeffect; + +import edu.rpi.legup.model.PuzzleImporter; +import edu.rpi.legup.save.InvalidFileFormatException; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +public class RippleEffectImporter extends PuzzleImporter { + public RippleEffectImporter(RippleEffect rippleEffect) { + super(rippleEffect); + } + + + /** + * Puzzle setting to support row and column inputs + */ + @Override + public boolean acceptsRowsAndColumnsInput() { + return true; + } + + /** + * Puzzle setting to disable support for text input + */ + @Override + public boolean acceptsTextInput() { + return false; + } + + + /** + * Constructs empty RippleEffect gameboard as per the provided dimensions + * @param rows number of rows for the gameboard + * @param columns number of columns for the gameboard + */ + @Override + public void initializeBoard(int rows, int columns) { + // Womp + } + + + + /** + * Constructs RippleEffect gameboard + * @param node xml document node + * @throws InvalidFileFormatException if file is invalid + */ + @Override + public void initializeBoard(Node node) throws InvalidFileFormatException { + if (node == null) throw new InvalidFileFormatException("Invalid format"); + } + + + + /** + * Initialize board via string of statements. + * @throws UnsupportedOperationException since RippleEffect does not support text input + */ + @Override + public void initializeBoard(String[] statements) throws UnsupportedOperationException { + throw new UnsupportedOperationException("Ripple Effect does not accept text input"); + } +} diff --git a/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectView.java b/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectView.java new file mode 100644 index 000000000..46647299f --- /dev/null +++ b/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectView.java @@ -0,0 +1,5 @@ +package edu.rpi.legup.puzzle.rippleeffect; + +public class RippleEffectView { + +} From 6b066ae62b5cdc1ea47826bd6e7224d1b8b13731 Mon Sep 17 00:00:00 2001 From: Chase-Grajeda Date: Fri, 9 Feb 2024 16:16:32 -0500 Subject: [PATCH 06/17] RippleEffect importer Added more dependencies for RippleEffect board Added config for RippleEffect editing support --- bin/main/edu/rpi/legup/legup/config | 4 ++++ .../legup/puzzle/rippleeffect/RippleEffect.java | 2 +- .../puzzle/rippleeffect/RippleEffectBoard.java | 9 +++++++++ .../puzzle/rippleeffect/RippleEffectCell.java | 9 +++++++-- .../rippleeffect/RippleEffectCellType.java | 10 ++++++++++ .../rippleeffect/RippleEffectImporter.java | 16 ++++++++++++++-- src/main/resources/edu/rpi/legup/legup/config | 4 ++++ 7 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectBoard.java create mode 100644 src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectCellType.java diff --git a/bin/main/edu/rpi/legup/legup/config b/bin/main/edu/rpi/legup/legup/config index 19e63a2a3..4428411c2 100644 --- a/bin/main/edu/rpi/legup/legup/config +++ b/bin/main/edu/rpi/legup/legup/config @@ -39,5 +39,9 @@ qualifiedClassName="edu.rpi.legup.puzzle.skyscrapers.Skyscrapers" fileType=".xml" fileCreationDisabled="true"/> + diff --git a/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffect.java b/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffect.java index 73efb46eb..761331b9b 100644 --- a/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffect.java +++ b/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffect.java @@ -22,7 +22,7 @@ public RippleEffect() { super(); this.name = "RippleEffect"; - // this.importer = new LightUpImporter(this); + this.importer = new RippleEffectImporter(this); // this.exporter = new LightUpExporter(this); // this.factory = new LightUpCellFactory(); diff --git a/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectBoard.java b/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectBoard.java new file mode 100644 index 000000000..0c1abbe27 --- /dev/null +++ b/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectBoard.java @@ -0,0 +1,9 @@ +package edu.rpi.legup.puzzle.rippleeffect; + +import edu.rpi.legup.model.gameboard.GridBoard; + +public class RippleEffectBoard extends GridBoard { + public RippleEffectBoard(int width, int height) { + super(width, height); + } +} diff --git a/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectCell.java b/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectCell.java index b8a4da825..20edf27f5 100644 --- a/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectCell.java +++ b/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectCell.java @@ -1,5 +1,10 @@ package edu.rpi.legup.puzzle.rippleeffect; -public class RippleEffectCell { - +import edu.rpi.legup.model.gameboard.GridCell; +import java.awt.Point; + +public class RippleEffectCell extends GridCell { + public RippleEffectCell(RippleEffectCellType type, Point location) { + super(type, location); + } } diff --git a/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectCellType.java b/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectCellType.java new file mode 100644 index 000000000..2442b898e --- /dev/null +++ b/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectCellType.java @@ -0,0 +1,10 @@ +package edu.rpi.legup.puzzle.rippleeffect; + +public enum RippleEffectCellType { + EMPTY(0), FILLED(1); + public int value; + + RippleEffectCellType(int value) { + this.value = value; + } +} diff --git a/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectImporter.java b/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectImporter.java index 7b3b25bac..bff0765e3 100644 --- a/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectImporter.java +++ b/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectImporter.java @@ -5,13 +5,13 @@ import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; +import java.awt.Point; public class RippleEffectImporter extends PuzzleImporter { public RippleEffectImporter(RippleEffect rippleEffect) { super(rippleEffect); } - /** * Puzzle setting to support row and column inputs */ @@ -36,7 +36,19 @@ public boolean acceptsTextInput() { */ @Override public void initializeBoard(int rows, int columns) { - // Womp + RippleEffectBoard rippleEffectBoard = new RippleEffectBoard(rows, columns); + for (int y = 0; y < rows; y++) { + for (int x = 0; x < columns; x++) { + // new ripple effect cell + if (rippleEffectBoard.getCell(x, y) == null) { + RippleEffectCell cell = new RippleEffectCell(RippleEffectCellType.EMPTY, new Point(x, y)); + cell.setIndex(y * columns + x); + cell.setModifiable(true); + rippleEffectBoard.setCell(x, y, cell); + } + } + } + puzzle.setCurrentBoard(rippleEffectBoard); } diff --git a/src/main/resources/edu/rpi/legup/legup/config b/src/main/resources/edu/rpi/legup/legup/config index 19e63a2a3..4428411c2 100644 --- a/src/main/resources/edu/rpi/legup/legup/config +++ b/src/main/resources/edu/rpi/legup/legup/config @@ -39,5 +39,9 @@ qualifiedClassName="edu.rpi.legup.puzzle.skyscrapers.Skyscrapers" fileType=".xml" fileCreationDisabled="true"/> + From a33eb7cf69cc500898fc37af02cda34742d3fa72 Mon Sep 17 00:00:00 2001 From: pitbull51067 Date: Fri, 5 Apr 2024 17:39:32 -0400 Subject: [PATCH 07/17] Created file for version change, currently testing in private repository. --- .github/workflows/version_changer.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/version_changer.yml diff --git a/.github/workflows/version_changer.yml b/.github/workflows/version_changer.yml new file mode 100644 index 000000000..c4789416d --- /dev/null +++ b/.github/workflows/version_changer.yml @@ -0,0 +1,18 @@ +name: Update Text on Merge + +on: + push: + branches: + - master + +jobs: + update_text: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Update text file + run: | + echo "File updated due to merge" >> legup-update/bin/main/edu.rpi.legupupdate/VERSION.txt + if: github.event_name == 'push' && github.ref == 'refs/heads/master' \ No newline at end of file From 7e0aace53b103caadf63b982e8ec43a03cda387b Mon Sep 17 00:00:00 2001 From: pitbull51067 Date: Mon, 15 Apr 2024 15:09:02 -0400 Subject: [PATCH 08/17] This is the final code, I just have to change the path on Tuesday because I need to talk with my peers first. --- .github/workflows/version_changer.yml | 46 +++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/.github/workflows/version_changer.yml b/.github/workflows/version_changer.yml index c4789416d..4524c925d 100644 --- a/.github/workflows/version_changer.yml +++ b/.github/workflows/version_changer.yml @@ -1,18 +1,52 @@ -name: Update Text on Merge +name: Increment Version on Push on: push: branches: - - master + - main jobs: - update_text: + increment_version: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 - - name: Update text file + - name: Determine new version + id: update_version run: | - echo "File updated due to merge" >> legup-update/bin/main/edu.rpi.legupupdate/VERSION.txt - if: github.event_name == 'push' && github.ref == 'refs/heads/master' \ No newline at end of file + current_version=$( version.txt + + - name: Commit and push changes + run: | + git config --global user.email "your-email@example.com" + git config --global user.name "Your Name" + git add version.txt + git commit -m "Increment version number" + git push origin main \ No newline at end of file From 0a3ed2e7b90a3baded02c3e266013effdabe4ea5 Mon Sep 17 00:00:00 2001 From: pitbull51067 Date: Tue, 16 Apr 2024 16:14:53 -0400 Subject: [PATCH 09/17] Let's see if it works --- .github/workflows/version_changer.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/version_changer.yml b/.github/workflows/version_changer.yml index 4524c925d..eb22b5519 100644 --- a/.github/workflows/version_changer.yml +++ b/.github/workflows/version_changer.yml @@ -15,7 +15,7 @@ jobs: - name: Determine new version id: update_version run: | - current_version=$( version.txt + run: echo "${{ steps.update_version.outputs.version }}" > legup-update/bin/main/edu.rpi.legupupdate/VERSION - name: Commit and push changes run: | - git config --global user.email "your-email@example.com" - git config --global user.name "Your Name" - git add version.txt + git config --global user.email "pitbull51067@yahoo.com" + git config --global user.name "Pitbull51067" + git add legup-update/bin/main/edu.rpi.legupupdate/VERSION git commit -m "Increment version number" git push origin main \ No newline at end of file From c9b92af71b03691e1533d9d3e22e73f911eee441 Mon Sep 17 00:00:00 2001 From: pitbull51067 Date: Tue, 16 Apr 2024 16:20:05 -0400 Subject: [PATCH 10/17] Trying to get the file right. --- .github/workflows/version_changer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/version_changer.yml b/.github/workflows/version_changer.yml index eb22b5519..7accdd44d 100644 --- a/.github/workflows/version_changer.yml +++ b/.github/workflows/version_changer.yml @@ -3,7 +3,7 @@ name: Increment Version on Push on: push: branches: - - main + - Regions jobs: increment_version: From ed15760c8fda70b0d6332cf49a26c0df4ec0c585 Mon Sep 17 00:00:00 2001 From: pitbull51067 Date: Tue, 16 Apr 2024 16:23:18 -0400 Subject: [PATCH 11/17] Trying to ignore the.gitignore flag. --- .github/workflows/version_changer.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/version_changer.yml b/.github/workflows/version_changer.yml index 7accdd44d..665cb88b1 100644 --- a/.github/workflows/version_changer.yml +++ b/.github/workflows/version_changer.yml @@ -47,6 +47,6 @@ jobs: run: | git config --global user.email "pitbull51067@yahoo.com" git config --global user.name "Pitbull51067" - git add legup-update/bin/main/edu.rpi.legupupdate/VERSION + git add -f legup-update/bin/main/edu.rpi.legupupdate/VERSION git commit -m "Increment version number" - git push origin main \ No newline at end of file + git push \ No newline at end of file From dea0ac6707c94a80c58dcc51e61b358086eb708c Mon Sep 17 00:00:00 2001 From: pitbull51067 Date: Tue, 16 Apr 2024 16:27:01 -0400 Subject: [PATCH 12/17] let's try now that we have more permission --- legup-update/bin/main/edu.rpi.legupupdate/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/legup-update/bin/main/edu.rpi.legupupdate/VERSION b/legup-update/bin/main/edu.rpi.legupupdate/VERSION index 227cea215..c70654ddb 100644 --- a/legup-update/bin/main/edu.rpi.legupupdate/VERSION +++ b/legup-update/bin/main/edu.rpi.legupupdate/VERSION @@ -1 +1 @@ -2.0.0 +1.9.9 \ No newline at end of file From 9a9acfefd2e564ba62caa31c28f0fae9bb2aa441 Mon Sep 17 00:00:00 2001 From: pitbull51067 Date: Tue, 16 Apr 2024 16:31:11 -0400 Subject: [PATCH 13/17] We gave GitHub actions permission to write. --- legup-update/bin/main/edu.rpi.legupupdate/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/legup-update/bin/main/edu.rpi.legupupdate/VERSION b/legup-update/bin/main/edu.rpi.legupupdate/VERSION index c70654ddb..f5f0aa630 100644 --- a/legup-update/bin/main/edu.rpi.legupupdate/VERSION +++ b/legup-update/bin/main/edu.rpi.legupupdate/VERSION @@ -1 +1 @@ -1.9.9 \ No newline at end of file +1.9.8 \ No newline at end of file From 2e51bb514374c61b186a8c4d6807157cf65e72c9 Mon Sep 17 00:00:00 2001 From: Pitbull51067 Date: Tue, 16 Apr 2024 20:31:25 +0000 Subject: [PATCH 14/17] Increment version number --- legup-update/bin/main/edu.rpi.legupupdate/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/legup-update/bin/main/edu.rpi.legupupdate/VERSION b/legup-update/bin/main/edu.rpi.legupupdate/VERSION index f5f0aa630..6ae756c47 100644 --- a/legup-update/bin/main/edu.rpi.legupupdate/VERSION +++ b/legup-update/bin/main/edu.rpi.legupupdate/VERSION @@ -1 +1 @@ -1.9.8 \ No newline at end of file +1.9.9 From f0f1476f1a43c43dca2b857bdced9e84b437b6d5 Mon Sep 17 00:00:00 2001 From: pitbull51067 Date: Tue, 16 Apr 2024 16:35:42 -0400 Subject: [PATCH 15/17] This is for the final version before I make my pull request. Changed path and version number. --- .github/workflows/version_changer.yml | 2 +- legup-update/bin/main/edu.rpi.legupupdate/VERSION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/version_changer.yml b/.github/workflows/version_changer.yml index 665cb88b1..97b2545b0 100644 --- a/.github/workflows/version_changer.yml +++ b/.github/workflows/version_changer.yml @@ -3,7 +3,7 @@ name: Increment Version on Push on: push: branches: - - Regions + - master jobs: increment_version: diff --git a/legup-update/bin/main/edu.rpi.legupupdate/VERSION b/legup-update/bin/main/edu.rpi.legupupdate/VERSION index 6ae756c47..6d54bbd77 100644 --- a/legup-update/bin/main/edu.rpi.legupupdate/VERSION +++ b/legup-update/bin/main/edu.rpi.legupupdate/VERSION @@ -1 +1 @@ -1.9.9 +6.0.1 \ No newline at end of file From 88bcf1df1103027756d6db704732cd604951ab0b Mon Sep 17 00:00:00 2001 From: pitbull51067 Date: Tue, 16 Apr 2024 16:44:54 -0400 Subject: [PATCH 16/17] Final commit after updating branch. --- .github/workflows/{version_changer.yml => version-changer.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{version_changer.yml => version-changer.yml} (100%) diff --git a/.github/workflows/version_changer.yml b/.github/workflows/version-changer.yml similarity index 100% rename from .github/workflows/version_changer.yml rename to .github/workflows/version-changer.yml From 119b9a6e81627a1397b2e75f25f624923706c5f1 Mon Sep 17 00:00:00 2001 From: pitbull51067 Date: Tue, 21 Jan 2025 16:48:17 -0500 Subject: [PATCH 17/17] Version Changer Only --- .../puzzle/rippleeffect/RippleEffect.java | 99 ------------------- .../rippleeffect/RippleEffectBoard.java | 9 -- .../puzzle/rippleeffect/RippleEffectCell.java | 10 -- .../rippleeffect/RippleEffectCellType.java | 10 -- .../rippleeffect/RippleEffectImporter.java | 76 -------------- .../puzzle/rippleeffect/RippleEffectView.java | 5 - .../FinishWithBlackDirectRule/FinishSides | 12 +++ 7 files changed, 12 insertions(+), 209 deletions(-) delete mode 100644 src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffect.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectBoard.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectCell.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectCellType.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectImporter.java delete mode 100644 src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectView.java create mode 100644 src/test/resources/puzzles/fillapix/rules/FinishWithBlackDirectRule/FinishSides diff --git a/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffect.java b/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffect.java deleted file mode 100644 index 761331b9b..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffect.java +++ /dev/null @@ -1,99 +0,0 @@ -package edu.rpi.legup.puzzle.rippleeffect; - -import edu.rpi.legup.model.Puzzle; -import edu.rpi.legup.model.RegisterPuzzle; -import edu.rpi.legup.model.gameboard.Board; -import edu.rpi.legup.model.gameboard.PuzzleElement; -import edu.rpi.legup.model.rules.ContradictionRule; - - -/** - * 1) Number is duplicated in a row or a column, the space between the duplicated numbers must be equal to or larger than the value of the number. - * 2) Each Room contains consecutive numbers starting from 1. - * 3) If a number is duplicated in a row or a column, the space between the duplicated numbers must be equal to or larger than the value of the number. - */ - - - -@RegisterPuzzle -public class RippleEffect extends Puzzle { - - public RippleEffect() { - super(); - this.name = "RippleEffect"; - - this.importer = new RippleEffectImporter(this); - // this.exporter = new LightUpExporter(this); - - // this.factory = new LightUpCellFactory(); - } - - /** - * Initializes the game board. Called by the invoker of the class - */ - @Override - public void initializeView() { - // boardView = new LightUpView((LightUpBoard) currentBoard); - // boardView.setBoard(currentBoard); - // addBoardListener(boardView); - } - - /** - * Generates a random edu.rpi.legup.puzzle based on the difficulty - * - * @param difficulty level of difficulty (1-10) - * @return board of the random edu.rpi.legup.puzzle - */ - @Override - public Board generatePuzzle(int difficulty) { - return null; - } - - @Override - /** - * Determines if the given dimensions are valid for Light Up - * - * @param rows the number of rows - * @param columns the number of columns - * @return true if the given dimensions are valid for Light Up, false otherwise - */ - public boolean isValidDimensions(int rows, int columns) { - return rows > 0 && columns > 0; - } - - /** - * Determines if the current board is a valid state - * - * @param board board to check for validity - * @return true if board is valid, false otherwise - */ - @Override - public boolean isBoardComplete(Board board) { - // LightUpBoard lightUpBoard = (LightUpBoard) board; - // lightUpBoard.fillWithLight(); - - // for (ContradictionRule rule : contradictionRules) { - // if (rule.checkContradiction(lightUpBoard) == null) { - // System.out.println(rule.getRuleName()); - // return false; - // } - // } - // for (PuzzleElement data : lightUpBoard.getPuzzleElements()) { - // LightUpCell cell = (LightUpCell) data; - // if ((cell.getType() == LightUpCellType.UNKNOWN || cell.getType() == LightUpCellType.EMPTY) && !cell.isLite()) { - // return false; - // } - // } - return true; - } - - /** - * Callback for when the board puzzleElement changes - * - * @param board the board that has changed - */ - @Override - public void onBoardChange(Board board) { - - } -} diff --git a/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectBoard.java b/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectBoard.java deleted file mode 100644 index 0c1abbe27..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectBoard.java +++ /dev/null @@ -1,9 +0,0 @@ -package edu.rpi.legup.puzzle.rippleeffect; - -import edu.rpi.legup.model.gameboard.GridBoard; - -public class RippleEffectBoard extends GridBoard { - public RippleEffectBoard(int width, int height) { - super(width, height); - } -} diff --git a/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectCell.java b/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectCell.java deleted file mode 100644 index 20edf27f5..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectCell.java +++ /dev/null @@ -1,10 +0,0 @@ -package edu.rpi.legup.puzzle.rippleeffect; - -import edu.rpi.legup.model.gameboard.GridCell; -import java.awt.Point; - -public class RippleEffectCell extends GridCell { - public RippleEffectCell(RippleEffectCellType type, Point location) { - super(type, location); - } -} diff --git a/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectCellType.java b/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectCellType.java deleted file mode 100644 index 2442b898e..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectCellType.java +++ /dev/null @@ -1,10 +0,0 @@ -package edu.rpi.legup.puzzle.rippleeffect; - -public enum RippleEffectCellType { - EMPTY(0), FILLED(1); - public int value; - - RippleEffectCellType(int value) { - this.value = value; - } -} diff --git a/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectImporter.java b/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectImporter.java deleted file mode 100644 index bff0765e3..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectImporter.java +++ /dev/null @@ -1,76 +0,0 @@ -package edu.rpi.legup.puzzle.rippleeffect; - -import edu.rpi.legup.model.PuzzleImporter; -import edu.rpi.legup.save.InvalidFileFormatException; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import java.awt.Point; - -public class RippleEffectImporter extends PuzzleImporter { - public RippleEffectImporter(RippleEffect rippleEffect) { - super(rippleEffect); - } - - /** - * Puzzle setting to support row and column inputs - */ - @Override - public boolean acceptsRowsAndColumnsInput() { - return true; - } - - /** - * Puzzle setting to disable support for text input - */ - @Override - public boolean acceptsTextInput() { - return false; - } - - - /** - * Constructs empty RippleEffect gameboard as per the provided dimensions - * @param rows number of rows for the gameboard - * @param columns number of columns for the gameboard - */ - @Override - public void initializeBoard(int rows, int columns) { - RippleEffectBoard rippleEffectBoard = new RippleEffectBoard(rows, columns); - for (int y = 0; y < rows; y++) { - for (int x = 0; x < columns; x++) { - // new ripple effect cell - if (rippleEffectBoard.getCell(x, y) == null) { - RippleEffectCell cell = new RippleEffectCell(RippleEffectCellType.EMPTY, new Point(x, y)); - cell.setIndex(y * columns + x); - cell.setModifiable(true); - rippleEffectBoard.setCell(x, y, cell); - } - } - } - puzzle.setCurrentBoard(rippleEffectBoard); - } - - - - /** - * Constructs RippleEffect gameboard - * @param node xml document node - * @throws InvalidFileFormatException if file is invalid - */ - @Override - public void initializeBoard(Node node) throws InvalidFileFormatException { - if (node == null) throw new InvalidFileFormatException("Invalid format"); - } - - - - /** - * Initialize board via string of statements. - * @throws UnsupportedOperationException since RippleEffect does not support text input - */ - @Override - public void initializeBoard(String[] statements) throws UnsupportedOperationException { - throw new UnsupportedOperationException("Ripple Effect does not accept text input"); - } -} diff --git a/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectView.java b/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectView.java deleted file mode 100644 index 46647299f..000000000 --- a/src/main/java/edu/rpi/legup/puzzle/rippleeffect/RippleEffectView.java +++ /dev/null @@ -1,5 +0,0 @@ -package edu.rpi.legup.puzzle.rippleeffect; - -public class RippleEffectView { - -} diff --git a/src/test/resources/puzzles/fillapix/rules/FinishWithBlackDirectRule/FinishSides b/src/test/resources/puzzles/fillapix/rules/FinishWithBlackDirectRule/FinishSides new file mode 100644 index 000000000..3129d8bea --- /dev/null +++ b/src/test/resources/puzzles/fillapix/rules/FinishWithBlackDirectRule/FinishSides @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file