Skip to content

Goal condition panel#959

Merged
PompaTy merged 6 commits intoBram-Hub:goalConditionfrom
Mystin:goalCondition
Feb 6, 2026
Merged

Goal condition panel#959
PompaTy merged 6 commits intoBram-Hub:goalConditionfrom
Mystin:goalCondition

Conversation

@Mystin
Copy link
Collaborator

@Mystin Mystin commented Feb 6, 2026

Description

Added a goal condition JLabel to the UI that explains to the user what the goal condition for a given puzzle is. This was accomplished by adding the getGoalText and various other function to the Goal class, which relies on the new describeState function in the GridCell class to provide a String describing what its data value means for the user, which should be overridden in every puzzle's cell class. This also fixed a few bugs regarding to PuzzleElement's isGoal value.

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?

4 additional test files have been added for Nurikabe to test that the label works and appropriately describes the goal condition for a variety of goal types and number of cells affected.

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 and others added 6 commits February 3, 2026 17:44
Added a new JLabel to describe the goal condition to the user.
Provide methods in Goal class to generate description text for the GoalPanel UI element. This label is given the text from GameBoardFacade, and additional methods need to be provided in each puzzle's cell class to describe their states.
Provides a more significant state description to NurikabeCell instances (black or white instead of data = -1 or data = 0)
Made additional test cases to test for correct wording and grammar in the goal condition text. Also changed PROVE_MULTIPLE_CELL_VALUE's text to reflect its condition.
Ensuring that cells being overwritten from the cell's clone method or during importation of transitions on file load doesn't erase the isGoal flag.
@PompaTy PompaTy merged commit 872123f into Bram-Hub:goalCondition Feb 6, 2026
6 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.

2 participants