Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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: