Skip to content

Caseboard functionality merged into Board class. - #996

Merged
jaydencarlson05 merged 4 commits into
Bram-Hub:devfrom
Laine0509:Caseboard
Oct 2, 2026
Merged

jaydencarlson05 merged 4 commits into
Bram-Hub:devfrom
Laine0509:Caseboard

Conversation

@Laine0509

@Laine0509 Laine0509 commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Caseboard itself had little functionality of its own that was not related to being a Board itself, so we merge the two classes. This means adding the caseRule and the set of pickablePuzzleElements to Board, the getters and setters of said variables, and the various functions related to them (addPickableElement, removePickableElement, getCount, isPickable). This also meant replacing every mention of CaseBoard as an object type being replaced with Board, and whenever it asks if "board instanceof CaseBoard" (board being a variable of the Board class) its replaced with "board.getCaseRule() != null" because only CaseBoards have caseRules in the current functionality. As a result of all of this, this meant deleting CaseBoard.java.

Closes #993

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Enhancement (improvement to an already existing feature)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested?

I have built the program to the .jar file and it opens without error. Additionally, using the functionality of "CaseBoard" in Nurikabe also printed no errors.

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@Mystin Mystin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good first PR! There are a few small changes I'd like to see which I left comments for, as well as some stuff that really isn't your fault but need to be changed regardless. Everything else looked really good and a big thanks for the effort you put into changing all of those rule classes.

Comment thread src/main/java/edu/rpi/legup/model/gameboard/Board.java Outdated
Comment thread src/main/java/edu/rpi/legup/model/gameboard/Board.java Outdated
Comment thread src/main/java/edu/rpi/legup/model/gameboard/Board.java
Comment thread src/main/java/edu/rpi/legup/puzzle/skyscrapers/rules/NumberForCellCaseRule.java Outdated
Comment thread src/main/java/edu/rpi/legup/puzzle/skyscrapers/SkyscrapersView.java

@Mystin Mystin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Board's javadoc could probably use some documentation that it has case rule functionality but the method javadocs suitably explain how it works. Good work 👍

@jaydencarlson05
jaydencarlson05 merged commit ea739aa into Bram-Hub:dev Oct 2, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants