Skip to content

Commit

Permalink
Team Thermometers final merge (#816)
Browse files Browse the repository at this point in the history
* Layout of project

* Added Mercury or Blocked case rule and updated ThermometerController and ThermometerFill. (#725)

Added the first rule case, no test cases yet.

Modified ThermometerController to reflect how the user will interact with the game.

Modified ThermometerFill to reflect controller

* Starting work on thermometer class

* Added Vial Class

Added the vial class which will be helpful for checking rules down the line

* Thermometer (#735)

* Starting work on thermometer class

* Added Vial Class

Added the vial class which will be helpful for checking rules down the line

* Discontinuous Mercury Rule added

Added the Discontinuous Mercury contradiciton rule. Added variables to the ThermometerBoard class to keep track of the numbers on the perimiter of the board as well as accessors/setters for these variables. Rewrote a section of the Vials code to make sure cells are added correctly as well as added some accessor functions.

* Thermometer (#738)

* Update ThermometerBoard.java

* Created element files

* Element/rule images

* Discontinuous Mercury Rule + Misc. behind the scenes changes (#739)

* Fixed Short Truth Table case rule bug (#707)

* Revert "Bugfix 549 (#682)"

This reverts commit 5048ee69d958fdde9b1bb35854c56c9920068346.

* Case rule test fix (#705)

Co-authored-by: Chase Grajeda <[email protected]>

* Rapid fix for STT case rules

Case rules broke at some point from legacy code or merge conflict. Provided is a quick fix in CaseRule and CaseRule_Generic

* Revert "Revert "Bugfix 549 (#682)"" (#706)

This reverts commit e9fe310378721aa4b4fa358aa57ec44f21d086c1.

---------

Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>

* Starting work on thermometer class

* Added Vial Class

Added the vial class which will be helpful for checking rules down the line

* Discontinuous Mercury Rule added

Added the Discontinuous Mercury contradiciton rule. Added variables to the ThermometerBoard class to keep track of the numbers on the perimiter of the board as well as accessors/setters for these variables. Rewrote a section of the Vials code to make sure cells are added correctly as well as added some accessor functions.

---------

Co-authored-by: Charles Tian <[email protected]>
Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>
Co-authored-by: Fuzzabee <[email protected]>

* Thermometer too many/few mercury (#747)

* Fixed Short Truth Table case rule bug (#707)

* Revert "Bugfix 549 (#682)"

This reverts commit 5048ee69d958fdde9b1bb35854c56c9920068346.

* Case rule test fix (#705)

Co-authored-by: Chase Grajeda <[email protected]>

* Rapid fix for STT case rules

Case rules broke at some point from legacy code or merge conflict. Provided is a quick fix in CaseRule and CaseRule_Generic

* Revert "Revert "Bugfix 549 (#682)"" (#706)

This reverts commit e9fe310378721aa4b4fa358aa57ec44f21d086c1.

---------

Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>

* Skyscrapers Test Suite (#708)

* Simplify rule names

* Contradiction Test Suite

* checkstyle

* Update Exporter

* Revert "Update Exporter"

This reverts commit bae1a1f531e407e3b9dd1d28cc79330aa181f410.

* Case Rule Test Suite

* Update SkyscrapersExporter.java

* allow null transitions

* Update TreeTransition.java

* Direct Rule Test Suite

* added tests pass

* Update DirectRule.java

Commenting out print statement

---------

Co-authored-by: ThisMatt <[email protected]>
Co-authored-by: ThisMatt <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>

* Update ThermometerBoard.java

* Skyscrapers puzzle editor (#720)

* Fixed Short Truth Table case rule bug (#707)

* Revert "Bugfix 549 (#682)"

This reverts commit 5048ee69d958fdde9b1bb35854c56c9920068346.

* Case rule test fix (#705)

Co-authored-by: Chase Grajeda <[email protected]>

* Rapid fix for STT case rules

Case rules broke at some point from legacy code or merge conflict. Provided is a quick fix in CaseRule and CaseRule_Generic

* Revert "Revert "Bugfix 549 (#682)"" (#706)

This reverts commit e9fe310378721aa4b4fa358aa57ec44f21d086c1.

---------

Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>

* Implementing Puzzle Editor

Removing Extraneous TreeTent Code
Allowing setting tile number

* Allow for editing clues on all axies

* Remove Extraneous Code

Removed functionality required for TreeTent but unnecessary for Skyscrapers

* Remove Extraneous Code

* Clue Tile in Editor

Editor now requires selecting the clue tile to edit clues
Added images for the tiles

* Merge branch 'dev' into skyscrapersPuzzleEditor

* Checkstyle Requirement

* Necessary Code

* Allow for test functionality

---------

Co-authored-by: Charles Tian <[email protected]>
Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>

* Created element files

* Element/rule images

* Java Autoformatter (#728)

* Create java-autoformat.yml

* Setup Java

* Run spotless on repository

* Adding spotless dependency during build

* Adding spotless dependency during build

* Give permissions to run spotless

* Syntax

* Adding Debug Tag

* Check for modified files

Also removed debug tag

* Automated Java code formatting changes

* Test command syntax

* Correctly Identify modified files

* Test autoformatter

* Test autoformatter

* Test autoformatter

* Debugging

* Debugging

* Change method for detecting changed files

* Try building before calling spotless

* Update java-autoformat.yml

* Update java-autoformat.yml

* Update java-autoformat.yml

* Purposely bad formatting

Purposely adding some bad formatting to see if the auto-formatter triggers

* Update build.gradle

Disabling Checkstyle in build so the auto-formatter can trigger

* Update java-autoformat.yml

Have auto-formatter trigger when more commits are added to a pull request

* Debugging

* Adding more awful formatting

* Update java-autoformat.yml

* Changing repo URL

* Going back to checkout v1

* Trying URL change

* Trying out using env

* Trying this now...?

* Introducing more horrible changes

* Spotless formatting using google format v1.19.2

* Manual formatting fix

* Automated Java code formatting changes

* Different format type

Trying to get it to pass checkstyle

* Disable checkstyle temporarily

* Automated Java code formatting changes

* Default google formatting style

* Automated Java code formatting changes

* Comments and reordering styles

* Adding extra newlines

* Automated Java code formatting changes

* Changing tabs from 2 to 4 spaces

Supposedly the only difference that aosp makes is the 2 spaces?
Hopefully it doesn't break anything else

* Remove solo } requirement and reactivate checkstyle

* Automated Java code formatting changes

* Update checkstyle.xml

Removed problematic LeftCurly and RightCurly requirements

* Changing back to tabWidth

* Add newline to test formatter + build

* Automated Java code formatting changes

* Trying some ChatGPT stuff

* Getting rid of problematic experimentation

---------

Co-authored-by: Bram van Heuveln <[email protected]>
Co-authored-by: Charles Tian <[email protected]>
Co-authored-by: charlestian23 <[email protected]>

* Java21 (#714)

* Fixed Short Truth Table case rule bug (#707)

* Revert "Bugfix 549 (#682)"

This reverts commit 5048ee69d958fdde9b1bb35854c56c9920068346.

* Case rule test fix (#705)

Co-authored-by: Chase Grajeda <[email protected]>

* Rapid fix for STT case rules

Case rules broke at some point from legacy code or merge conflict. Provided is a quick fix in CaseRule and CaseRule_Generic

* Revert "Revert "Bugfix 549 (#682)"" (#706)

This reverts commit e9fe310378721aa4b4fa358aa57ec44f21d086c1.

---------

Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>

* Change Java version to 21 and setup JPackage to bundle Java with the app

* Setup gradle action for java 21

* Fix distribution in gradle.yml

* Fix java version in tests

* Fix java distribution in tests

* Add jpackage task

* Add Linux to jpackage task

* Fix jpackage task

* Add java setup to jpackage tasks

* Separate build into separate tasks for different operating systems

* Fix mac jpackage not working and changed names of artifacts

* Potential macos installer build fix

* Potential macos installer build fix attempt 2

* Potential macos installer build fix attempt 3

* Add quotes around executable name for macos installer

* Add logo and shortcut prompt

* Update version in build.gradle

* Make installer name different to app (It's a weird way to do it, it renames the file in a gradle task).

* Update java-autoformat.yml

Added check to make sure the pull request is not from a fork

---------

Co-authored-by: Charles Tian <[email protected]>
Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>
Co-authored-by: charlestian23 <[email protected]>

* Update build.gradle (#741)

* Update build.gradle

Fixing the deprecation issues in the autoformatter

* Update build.gradle

* Update build.gradle

* Update to use Java 21

* Automated Java code formatting changes

---------

Co-authored-by: Bram van Heuveln <[email protected]>

* Updating to version 6.0.0

Changing to 6.0.0 since Java upgrade may break backwards compatibility

* Too many mercury 1st draft

* Too few mercury contradiction rule

* error fixes

---------

Co-authored-by: Charles Tian <[email protected]>
Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>
Co-authored-by: ThisMatt <[email protected]>
Co-authored-by: ThisMatt <[email protected]>
Co-authored-by: Jaden Tian <[email protected]>
Co-authored-by: Bram van Heuveln <[email protected]>
Co-authored-by: charlestian23 <[email protected]>
Co-authored-by: Fisher Luba <[email protected]>

* Importer written

First draft of the importer written and setData refactored

* small bug fixes

* Added outlines of Finish...WithEmptyDirectRule and RestIsEmptyDirectRule. Need to figure out best way to incorporate these rules when we have time to meet.

* Uploading test xml file for eventual testing

* Added Puzzle Factory and Importer

Refactored a bunch of code so we now (in theory) import correctly

* Thermometer Importer Functionality + Thermometer Puzzle Factory (#756)

* Fixed Short Truth Table case rule bug (#707)

* Revert "Bugfix 549 (#682)"

This reverts commit 5048ee69d958fdde9b1bb35854c56c9920068346.

* Case rule test fix (#705)

Co-authored-by: Chase Grajeda <[email protected]>

* Rapid fix for STT case rules

Case rules broke at some point from legacy code or merge conflict. Provided is a quick fix in CaseRule and CaseRule_Generic

* Revert "Revert "Bugfix 549 (#682)"" (#706)

This reverts commit e9fe310378721aa4b4fa358aa57ec44f21d086c1.

---------

Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>

* Starting work on thermometer class

* Added Vial Class

Added the vial class which will be helpful for checking rules down the line

* Discontinuous Mercury Rule added

Added the Discontinuous Mercury contradiciton rule. Added variables to the ThermometerBoard class to keep track of the numbers on the perimiter of the board as well as accessors/setters for these variables. Rewrote a section of the Vials code to make sure cells are added correctly as well as added some accessor functions.

* Importer written

First draft of the importer written and setData refactored

* small bug fixes

* Added Puzzle Factory and Importer

Refactored a bunch of code so we now (in theory) import correctly

---------

Co-authored-by: Charles Tian <[email protected]>
Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>
Co-authored-by: Fuzzabee <[email protected]>

* Started Exported and added to ThermometerBoard access to row and col values

* Adding ThermometerExporter.java and therm_test.xml (#759)

* Thermometer Importer Functionality + Thermometer Puzzle Factory (#756) (#1)

* Fixed Short Truth Table case rule bug (#707)

* Revert "Bugfix 549 (#682)"

This reverts commit 5048ee69d958fdde9b1bb35854c56c9920068346.

* Case rule test fix (#705)



* Rapid fix for STT case rules

Case rules broke at some point from legacy code or merge conflict. Provided is a quick fix in CaseRule and CaseRule_Generic

* Revert "Revert "Bugfix 549 (#682)"" (#706)

This reverts commit e9fe310378721aa4b4fa358aa57ec44f21d086c1.

---------




* Starting work on thermometer class

* Added Vial Class

Added the vial class which will be helpful for checking rules down the line

* Discontinuous Mercury Rule added

Added the Discontinuous Mercury contradiciton rule. Added variables to the ThermometerBoard class to keep track of the numbers on the perimiter of the board as well as accessors/setters for these variables. Rewrote a section of the Vials code to make sure cells are added correctly as well as added some accessor functions.

* Importer written

First draft of the importer written and setData refactored

* small bug fixes

* Added Puzzle Factory and Importer

Refactored a bunch of code so we now (in theory) import correctly

---------

Co-authored-by: ZevCe <[email protected]>
Co-authored-by: Charles Tian <[email protected]>
Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>

* Update ThermometerExporter.java

* Git issues, trying to fix

---------

Co-authored-by: ZevCe <[email protected]>
Co-authored-by: Charles Tian <[email protected]>
Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>

* Delete ThermometerExporter.java

* Added Thermometer to Config file

* Quick Config File change (#761)

* Fixed Short Truth Table case rule bug (#707)

* Revert "Bugfix 549 (#682)"

This reverts commit 5048ee69d958fdde9b1bb35854c56c9920068346.

* Case rule test fix (#705)

Co-authored-by: Chase Grajeda <[email protected]>

* Rapid fix for STT case rules

Case rules broke at some point from legacy code or merge conflict. Provided is a quick fix in CaseRule and CaseRule_Generic

* Revert "Revert "Bugfix 549 (#682)"" (#706)

This reverts commit e9fe310378721aa4b4fa358aa57ec44f21d086c1.

---------

Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>

* Skyscrapers Test Suite (#708)

* Simplify rule names

* Contradiction Test Suite

* checkstyle

* Update Exporter

* Revert "Update Exporter"

This reverts commit bae1a1f531e407e3b9dd1d28cc79330aa181f410.

* Case Rule Test Suite

* Update SkyscrapersExporter.java

* allow null transitions

* Update TreeTransition.java

* Direct Rule Test Suite

* added tests pass

* Update DirectRule.java

Commenting out print statement

---------

Co-authored-by: ThisMatt <[email protected]>
Co-authored-by: ThisMatt <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>

* Skyscrapers puzzle editor (#720)

* Fixed Short Truth Table case rule bug (#707)

* Revert "Bugfix 549 (#682)"

This reverts commit 5048ee69d958fdde9b1bb35854c56c9920068346.

* Case rule test fix (#705)

Co-authored-by: Chase Grajeda <[email protected]>

* Rapid fix for STT case rules

Case rules broke at some point from legacy code or merge conflict. Provided is a quick fix in CaseRule and CaseRule_Generic

* Revert "Revert "Bugfix 549 (#682)"" (#706)

This reverts commit e9fe310378721aa4b4fa358aa57ec44f21d086c1.

---------

Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>

* Implementing Puzzle Editor

Removing Extraneous TreeTent Code
Allowing setting tile number

* Allow for editing clues on all axies

* Remove Extraneous Code

Removed functionality required for TreeTent but unnecessary for Skyscrapers

* Remove Extraneous Code

* Clue Tile in Editor

Editor now requires selecting the clue tile to edit clues
Added images for the tiles

* Merge branch 'dev' into skyscrapersPuzzleEditor

* Checkstyle Requirement

* Necessary Code

* Allow for test functionality

---------

Co-authored-by: Charles Tian <[email protected]>
Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>

* Starting work on thermometer class

* Added Vial Class

Added the vial class which will be helpful for checking rules down the line

* Discontinuous Mercury Rule added

Added the Discontinuous Mercury contradiciton rule. Added variables to the ThermometerBoard class to keep track of the numbers on the perimiter of the board as well as accessors/setters for these variables. Rewrote a section of the Vials code to make sure cells are added correctly as well as added some accessor functions.

* Java Autoformatter (#728)

* Create java-autoformat.yml

* Setup Java

* Run spotless on repository

* Adding spotless dependency during build

* Adding spotless dependency during build

* Give permissions to run spotless

* Syntax

* Adding Debug Tag

* Check for modified files

Also removed debug tag

* Automated Java code formatting changes

* Test command syntax

* Correctly Identify modified files

* Test autoformatter

* Test autoformatter

* Test autoformatter

* Debugging

* Debugging

* Change method for detecting changed files

* Try building before calling spotless

* Update java-autoformat.yml

* Update java-autoformat.yml

* Update java-autoformat.yml

* Purposely bad formatting

Purposely adding some bad formatting to see if the auto-formatter triggers

* Update build.gradle

Disabling Checkstyle in build so the auto-formatter can trigger

* Update java-autoformat.yml

Have auto-formatter trigger when more commits are added to a pull request

* Debugging

* Adding more awful formatting

* Update java-autoformat.yml

* Changing repo URL

* Going back to checkout v1

* Trying URL change

* Trying out using env

* Trying this now...?

* Introducing more horrible changes

* Spotless formatting using google format v1.19.2

* Manual formatting fix

* Automated Java code formatting changes

* Different format type

Trying to get it to pass checkstyle

* Disable checkstyle temporarily

* Automated Java code formatting changes

* Default google formatting style

* Automated Java code formatting changes

* Comments and reordering styles

* Adding extra newlines

* Automated Java code formatting changes

* Changing tabs from 2 to 4 spaces

Supposedly the only difference that aosp makes is the 2 spaces?
Hopefully it doesn't break anything else

* Remove solo } requirement and reactivate checkstyle

* Automated Java code formatting changes

* Update checkstyle.xml

Removed problematic LeftCurly and RightCurly requirements

* Changing back to tabWidth

* Add newline to test formatter + build

* Automated Java code formatting changes

* Trying some ChatGPT stuff

* Getting rid of problematic experimentation

---------

Co-authored-by: Bram van Heuveln <[email protected]>
Co-authored-by: Charles Tian <[email protected]>
Co-authored-by: charlestian23 <[email protected]>

* Java21 (#714)

* Fixed Short Truth Table case rule bug (#707)

* Revert "Bugfix 549 (#682)"

This reverts commit 5048ee69d958fdde9b1bb35854c56c9920068346.

* Case rule test fix (#705)

Co-authored-by: Chase Grajeda <[email protected]>

* Rapid fix for STT case rules

Case rules broke at some point from legacy code or merge conflict. Provided is a quick fix in CaseRule and CaseRule_Generic

* Revert "Revert "Bugfix 549 (#682)"" (#706)

This reverts commit e9fe310378721aa4b4fa358aa57ec44f21d086c1.

---------

Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>

* Change Java version to 21 and setup JPackage to bundle Java with the app

* Setup gradle action for java 21

* Fix distribution in gradle.yml

* Fix java version in tests

* Fix java distribution in tests

* Add jpackage task

* Add Linux to jpackage task

* Fix jpackage task

* Add java setup to jpackage tasks

* Separate build into separate tasks for different operating systems

* Fix mac jpackage not working and changed names of artifacts

* Potential macos installer build fix

* Potential macos installer build fix attempt 2

* Potential macos installer build fix attempt 3

* Add quotes around executable name for macos installer

* Add logo and shortcut prompt

* Update version in build.gradle

* Make installer name different to app (It's a weird way to do it, it renames the file in a gradle task).

* Update java-autoformat.yml

Added check to make sure the pull request is not from a fork

---------

Co-authored-by: Charles Tian <[email protected]>
Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>
Co-authored-by: charlestian23 <[email protected]>

* Update build.gradle (#741)

* Update build.gradle

Fixing the deprecation issues in the autoformatter

* Update build.gradle

* Update build.gradle

* Update to use Java 21

* Automated Java code formatting changes

---------

Co-authored-by: Bram van Heuveln <[email protected]>

* Updating to version 6.0.0

Changing to 6.0.0 since Java upgrade may break backwards compatibility

* Importer written

First draft of the importer written and setData refactored

* small bug fixes

* Added Puzzle Factory and Importer

Refactored a bunch of code so we now (in theory) import correctly

* Delete ThermometerExporter.java

* Added Thermometer to Config file

---------

Co-authored-by: Charles Tian <[email protected]>
Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>
Co-authored-by: ThisMatt <[email protected]>
Co-authored-by: ThisMatt <[email protected]>
Co-authored-by: Jaden Tian <[email protected]>
Co-authored-by: Bram van Heuveln <[email protected]>
Co-authored-by: charlestian23 <[email protected]>
Co-authored-by: Fisher Luba <[email protected]>
Co-authored-by: Fuzzabee <[email protected]>

* Added necessary code to constructor

* Messing with Rule Recognition

* Retrofit because I forgot to merge for two weeks (#764)

* Fixed Short Truth Table case rule bug (#707)

* Revert "Bugfix 549 (#682)"

This reverts commit 5048ee69d958fdde9b1bb35854c56c9920068346.

* Case rule test fix (#705)

Co-authored-by: Chase Grajeda <[email protected]>

* Rapid fix for STT case rules

Case rules broke at some point from legacy code or merge conflict. Provided is a quick fix in CaseRule and CaseRule_Generic

* Revert "Revert "Bugfix 549 (#682)"" (#706)

This reverts commit e9fe310378721aa4b4fa358aa57ec44f21d086c1.

---------

Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>

* Skyscrapers Test Suite (#708)

* Simplify rule names

* Contradiction Test Suite

* checkstyle

* Update Exporter

* Revert "Update Exporter"

This reverts commit bae1a1f531e407e3b9dd1d28cc79330aa181f410.

* Case Rule Test Suite

* Update SkyscrapersExporter.java

* allow null transitions

* Update TreeTransition.java

* Direct Rule Test Suite

* added tests pass

* Update DirectRule.java

Commenting out print statement

---------

Co-authored-by: ThisMatt <[email protected]>
Co-authored-by: ThisMatt <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>

* Update ThermometerBoard.java

* Skyscrapers puzzle editor (#720)

* Fixed Short Truth Table case rule bug (#707)

* Revert "Bugfix 549 (#682)"

This reverts commit 5048ee69d958fdde9b1bb35854c56c9920068346.

* Case rule test fix (#705)

Co-authored-by: Chase Grajeda <[email protected]>

* Rapid fix for STT case rules

Case rules broke at some point from legacy code or merge conflict. Provided is a quick fix in CaseRule and CaseRule_Generic

* Revert "Revert "Bugfix 549 (#682)"" (#706)

This reverts commit e9fe310378721aa4b4fa358aa57ec44f21d086c1.

---------

Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>

* Implementing Puzzle Editor

Removing Extraneous TreeTent Code
Allowing setting tile number

* Allow for editing clues on all axies

* Remove Extraneous Code

Removed functionality required for TreeTent but unnecessary for Skyscrapers

* Remove Extraneous Code

* Clue Tile in Editor

Editor now requires selecting the clue tile to edit clues
Added images for the tiles

* Merge branch 'dev' into skyscrapersPuzzleEditor

* Checkstyle Requirement

* Necessary Code

* Allow for test functionality

---------

Co-authored-by: Charles Tian <[email protected]>
Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>

* Created element files

* Element/rule images

* Java Autoformatter (#728)

* Create java-autoformat.yml

* Setup Java

* Run spotless on repository

* Adding spotless dependency during build

* Adding spotless dependency during build

* Give permissions to run spotless

* Syntax

* Adding Debug Tag

* Check for modified files

Also removed debug tag

* Automated Java code formatting changes

* Test command syntax

* Correctly Identify modified files

* Test autoformatter

* Test autoformatter

* Test autoformatter

* Debugging

* Debugging

* Change method for detecting changed files

* Try building before calling spotless

* Update java-autoformat.yml

* Update java-autoformat.yml

* Update java-autoformat.yml

* Purposely bad formatting

Purposely adding some bad formatting to see if the auto-formatter triggers

* Update build.gradle

Disabling Checkstyle in build so the auto-formatter can trigger

* Update java-autoformat.yml

Have auto-formatter trigger when more commits are added to a pull request

* Debugging

* Adding more awful formatting

* Update java-autoformat.yml

* Changing repo URL

* Going back to checkout v1

* Trying URL change

* Trying out using env

* Trying this now...?

* Introducing more horrible changes

* Spotless formatting using google format v1.19.2

* Manual formatting fix

* Automated Java code formatting changes

* Different format type

Trying to get it to pass checkstyle

* Disable checkstyle temporarily

* Automated Java code formatting changes

* Default google formatting style

* Automated Java code formatting changes

* Comments and reordering styles

* Adding extra newlines

* Automated Java code formatting changes

* Changing tabs from 2 to 4 spaces

Supposedly the only difference that aosp makes is the 2 spaces?
Hopefully it doesn't break anything else

* Remove solo } requirement and reactivate checkstyle

* Automated Java code formatting changes

* Update checkstyle.xml

Removed problematic LeftCurly and RightCurly requirements

* Changing back to tabWidth

* Add newline to test formatter + build

* Automated Java code formatting changes

* Trying some ChatGPT stuff

* Getting rid of problematic experimentation

---------

Co-authored-by: Bram van Heuveln <[email protected]>
Co-authored-by: Charles Tian <[email protected]>
Co-authored-by: charlestian23 <[email protected]>

* Java21 (#714)

* Fixed Short Truth Table case rule bug (#707)

* Revert "Bugfix 549 (#682)"

This reverts commit 5048ee69d958fdde9b1bb35854c56c9920068346.

* Case rule test fix (#705)

Co-authored-by: Chase Grajeda <[email protected]>

* Rapid fix for STT case rules

Case rules broke at some point from legacy code or merge conflict. Provided is a quick fix in CaseRule and CaseRule_Generic

* Revert "Revert "Bugfix 549 (#682)"" (#706)

This reverts commit e9fe310378721aa4b4fa358aa57ec44f21d086c1.

---------

Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>

* Change Java version to 21 and setup JPackage to bundle Java with the app

* Setup gradle action for java 21

* Fix distribution in gradle.yml

* Fix java version in tests

* Fix java distribution in tests

* Add jpackage task

* Add Linux to jpackage task

* Fix jpackage task

* Add java setup to jpackage tasks

* Separate build into separate tasks for different operating systems

* Fix mac jpackage not working and changed names of artifacts

* Potential macos installer build fix

* Potential macos installer build fix attempt 2

* Potential macos installer build fix attempt 3

* Add quotes around executable name for macos installer

* Add logo and shortcut prompt

* Update version in build.gradle

* Make installer name different to app (It's a weird way to do it, it renames the file in a gradle task).

* Update java-autoformat.yml

Added check to make sure the pull request is not from a fork

---------

Co-authored-by: Charles Tian <[email protected]>
Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>
Co-authored-by: charlestian23 <[email protected]>

* Update build.gradle (#741)

* Update build.gradle

Fixing the deprecation issues in the autoformatter

* Update build.gradle

* Update build.gradle

* Update to use Java 21

* Automated Java code formatting changes

---------

Co-authored-by: Bram van Heuveln <[email protected]>

* Updating to version 6.0.0

Changing to 6.0.0 since Java upgrade may break backwards compatibility

* Too many mercury 1st draft

* Too few mercury contradiction rule

* error fixes

* misc cleanup

* Starting on case rules

* Rest is Empty direct rule and getHead for vials

* Prior is filled rule and getTail functionality

* Prior filled small fix

* Retrofit because I forgot to merge for 2 weeks

* Rest empty quick fix

---------

Co-authored-by: Charles Tian <[email protected]>
Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>
Co-authored-by: ThisMatt <[email protected]>
Co-authored-by: ThisMatt <[email protected]>
Co-authored-by: Jaden Tian <[email protected]>
Co-authored-by: Bram van Heuveln <[email protected]>
Co-authored-by: charlestian23 <[email protected]>
Co-authored-by: Fisher Luba <[email protected]>

* Fixing desyncs in repo

* More syncing and organizing files

* Thermometer (#766)

* Small misc improvements

Further work on getting a file to open without errors

* Fixed verify vial method

* Various thermometer fixes (#767)

* Fixed Short Truth Table case rule bug (#707)

* Revert "Bugfix 549 (#682)"

This reverts commit 5048ee69d958fdde9b1bb35854c56c9920068346.

* Case rule test fix (#705)

Co-authored-by: Chase Grajeda <[email protected]>

* Rapid fix for STT case rules

Case rules broke at some point from legacy code or merge conflict. Provided is a quick fix in CaseRule and CaseRule_Generic

* Revert "Revert "Bugfix 549 (#682)"" (#706)

This reverts commit e9fe310378721aa4b4fa358aa57ec44f21d086c1.

---------

Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>

* Skyscrapers Test Suite (#708)

* Simplify rule names

* Contradiction Test Suite

* checkstyle

* Update Exporter

* Revert "Update Exporter"

This reverts commit bae1a1f531e407e3b9dd1d28cc79330aa181f410.

* Case Rule Test Suite

* Update SkyscrapersExporter.java

* allow null transitions

* Update TreeTransition.java

* Direct Rule Test Suite

* added tests pass

* Update DirectRule.java

Commenting out print statement

---------

Co-authored-by: ThisMatt <[email protected]>
Co-authored-by: ThisMatt <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>

* Skyscrapers puzzle editor (#720)

* Fixed Short Truth Table case rule bug (#707)

* Revert "Bugfix 549 (#682)"

This reverts commit 5048ee69d958fdde9b1bb35854c56c9920068346.

* Case rule test fix (#705)

Co-authored-by: Chase Grajeda <[email protected]>

* Rapid fix for STT case rules

Case rules broke at some point from legacy code or merge conflict. Provided is a quick fix in CaseRule and CaseRule_Generic

* Revert "Revert "Bugfix 549 (#682)"" (#706)

This reverts commit e9fe310378721aa4b4fa358aa57ec44f21d086c1.

---------

Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>

* Implementing Puzzle Editor

Removing Extraneous TreeTent Code
Allowing setting tile number

* Allow for editing clues on all axies

* Remove Extraneous Code

Removed functionality required for TreeTent but unnecessary for Skyscrapers

* Remove Extraneous Code

* Clue Tile in Editor

Editor now requires selecting the clue tile to edit clues
Added images for the tiles

* Merge branch 'dev' into skyscrapersPuzzleEditor

* Checkstyle Requirement

* Necessary Code

* Allow for test functionality

---------

Co-authored-by: Charles Tian <[email protected]>
Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>

* Starting work on thermometer class

* Added Vial Class

Added the vial class which will be helpful for checking rules down the line

* Discontinuous Mercury Rule added

Added the Discontinuous Mercury contradiciton rule. Added variables to the ThermometerBoard class to keep track of the numbers on the perimiter of the board as well as accessors/setters for these variables. Rewrote a section of the Vials code to make sure cells are added correctly as well as added some accessor functions.

* Java Autoformatter (#728)

* Create java-autoformat.yml

* Setup Java

* Run spotless on repository

* Adding spotless dependency during build

* Adding spotless dependency during build

* Give permissions to run spotless

* Syntax

* Adding Debug Tag

* Check for modified files

Also removed debug tag

* Automated Java code formatting changes

* Test command syntax

* Correctly Identify modified files

* Test autoformatter

* Test autoformatter

* Test autoformatter

* Debugging

* Debugging

* Change method for detecting changed files

* Try building before calling spotless

* Update java-autoformat.yml

* Update java-autoformat.yml

* Update java-autoformat.yml

* Purposely bad formatting

Purposely adding some bad formatting to see if the auto-formatter triggers

* Update build.gradle

Disabling Checkstyle in build so the auto-formatter can trigger

* Update java-autoformat.yml

Have auto-formatter trigger when more commits are added to a pull request

* Debugging

* Adding more awful formatting

* Update java-autoformat.yml

* Changing repo URL

* Going back to checkout v1

* Trying URL change

* Trying out using env

* Trying this now...?

* Introducing more horrible changes

* Spotless formatting using google format v1.19.2

* Manual formatting fix

* Automated Java code formatting changes

* Different format type

Trying to get it to pass checkstyle

* Disable checkstyle temporarily

* Automated Java code formatting changes

* Default google formatting style

* Automated Java code formatting changes

* Comments and reordering styles

* Adding extra newlines

* Automated Java code formatting changes

* Changing tabs from 2 to 4 spaces

Supposedly the only difference that aosp makes is the 2 spaces?
Hopefully it doesn't break anything else

* Remove solo } requirement and reactivate checkstyle

* Automated Java code formatting changes

* Update checkstyle.xml

Removed problematic LeftCurly and RightCurly requirements

* Changing back to tabWidth

* Add newline to test formatter + build

* Automated Java code formatting changes

* Trying some ChatGPT stuff

* Getting rid of problematic experimentation

---------

Co-authored-by: Bram van Heuveln <[email protected]>
Co-authored-by: Charles Tian <[email protected]>
Co-authored-by: charlestian23 <[email protected]>

* Java21 (#714)

* Fixed Short Truth Table case rule bug (#707)

* Revert "Bugfix 549 (#682)"

This reverts commit 5048ee69d958fdde9b1bb35854c56c9920068346.

* Case rule test fix (#705)

Co-authored-by: Chase Grajeda <[email protected]>

* Rapid fix for STT case rules

Case rules broke at some point from legacy code or merge conflict. Provided is a quick fix in CaseRule and CaseRule_Generic

* Revert "Revert "Bugfix 549 (#682)"" (#706)

This reverts commit e9fe310378721aa4b4fa358aa57ec44f21d086c1.

---------

Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>

* Change Java version to 21 and setup JPackage to bundle Java with the app

* Setup gradle action for java 21

* Fix distribution in gradle.yml

* Fix java version in tests

* Fix java distribution in tests

* Add jpackage task

* Add Linux to jpackage task

* Fix jpackage task

* Add java setup to jpackage tasks

* Separate build into separate tasks for different operating systems

* Fix mac jpackage not working and changed names of artifacts

* Potential macos installer build fix

* Potential macos installer build fix attempt 2

* Potential macos installer build fix attempt 3

* Add quotes around executable name for macos installer

* Add logo and shortcut prompt

* Update version in build.gradle

* Make installer name different to app (It's a weird way to do it, it renames the file in a gradle task).

* Update java-autoformat.yml

Added check to make sure the pull request is not from a fork

---------

Co-authored-by: Charles Tian <[email protected]>
Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>
Co-authored-by: charlestian23 <[email protected]>

* Update build.gradle (#741)

* Update build.gradle

Fixing the deprecation issues in the autoformatter

* Update build.gradle

* Update build.gradle

* Update to use Java 21

* Automated Java code formatting changes

---------

Co-authored-by: Bram van Heuveln <[email protected]>

* Updating to version 6.0.0

Changing to 6.0.0 since Java upgrade may break backwards compatibility

* Importer written

First draft of the importer written and setData refactored

* small bug fixes

* Added Puzzle Factory and Importer

Refactored a bunch of code so we now (in theory) import correctly

* Delete ThermometerExporter.java

* Added Thermometer to Config file

* Added necessary code to constructor

* Messing with Rule Recognition

* Fixing desyncs in repo

* More syncing and organizing files

* Small misc improvements

Further work on getting a file to open without errors

* Fixed verify vial method

---------

Co-authored-by: Charles Tian <[email protected]>
Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>
Co-authored-by: ThisMatt <[email protected]>
Co-authored-by: ThisMatt <[email protected]>
Co-authored-by: Jaden Tian <[email protected]>
Co-authored-by: Bram van Heuveln <[email protected]>
Co-authored-by: charlestian23 <[email protected]>
Co-authored-by: Fisher Luba <[email protected]>
Co-authored-by: Fuzzabee <[email protected]>

* More work towards visual display

we now have semi working tials!

* Update ThermometerElementView.java

* Unfinished thermometer updates (#772)

* Thermometer (#773)

Adding images because real rotation is scary

* Rotating images!!!!!

* Thermometer with rotating images!!!! (#782)

* Added in placeable elements

* Stabilizing bug fixes

* Import silliness

* Bug fixes for the Thermometer Bug Fixes (#794)

* Fixed Short Truth Table case rule bug (#707)

* Revert "Bugfix 549 (#682)"

This reverts commit 5048ee69d958fdde9b1bb35854c56c9920068346.

* Case rule test fix (#705)

Co-authored-by: Chase Grajeda <[email protected]>

* Rapid fix for STT case rules

Case rules broke at some point from legacy code or merge conflict. Provided is a quick fix in CaseRule and CaseRule_Generic

* Revert "Revert "Bugfix 549 (#682)"" (#706)

This reverts commit e9fe310378721aa4b4fa358aa57ec44f21d086c1.

---------

Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>

* Skyscrapers Test Suite (#708)

* Simplify rule names

* Contradiction Test Suite

* checkstyle

* Update Exporter

* Revert "Update Exporter"

This reverts commit bae1a1f531e407e3b9dd1d28cc79330aa181f410.

* Case Rule Test Suite

* Update SkyscrapersExporter.java

* allow null transitions

* Update TreeTransition.java

* Direct Rule Test Suite

* added tests pass

* Update DirectRule.java

Commenting out print statement

---------

Co-authored-by: ThisMatt <[email protected]>
Co-authored-by: ThisMatt <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>

* Skyscrapers puzzle editor (#720)

* Fixed Short Truth Table case rule bug (#707)

* Revert "Bugfix 549 (#682)"

This reverts commit 5048ee69d958fdde9b1bb35854c56c9920068346.

* Case rule test fix (#705)

Co-authored-by: Chase Grajeda <[email protected]>

* Rapid fix for STT case rules

Case rules broke at some point from legacy code or merge conflict. Provided is a quick fix in CaseRule and CaseRule_Generic

* Revert "Revert "Bugfix 549 (#682)"" (#706)

This reverts commit e9fe310378721aa4b4fa358aa57ec44f21d086c1.

---------

Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>

* Implementing Puzzle Editor

Removing Extraneous TreeTent Code
Allowing setting tile number

* Allow for editing clues on all axies

* Remove Extraneous Code

Removed functionality required for TreeTent but unnecessary for Skyscrapers

* Remove Extraneous Code

* Clue Tile in Editor

Editor now requires selecting the clue tile to edit clues
Added images for the tiles

* Merge branch 'dev' into skyscrapersPuzzleEditor

* Checkstyle Requirement

* Necessary Code

* Allow for test functionality

---------

Co-authored-by: Charles Tian <[email protected]>
Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>

* Starting work on thermometer class

* Added Vial Class

Added the vial class which will be helpful for checking rules down the line

* Discontinuous Mercury Rule added

Added the Discontinuous Mercury contradiciton rule. Added variables to the ThermometerBoard class to keep track of the numbers on the perimiter of the board as well as accessors/setters for these variables. Rewrote a section of the Vials code to make sure cells are added correctly as well as added some accessor functions.

* Java Autoformatter (#728)

* Create java-autoformat.yml

* Setup Java

* Run spotless on repository

* Adding spotless dependency during build

* Adding spotless dependency during build

* Give permissions to run spotless

* Syntax

* Adding Debug Tag

* Check for modified files

Also removed debug tag

* Automated Java code formatting changes

* Test command syntax

* Correctly Identify modified files

* Test autoformatter

* Test autoformatter

* Test autoformatter

* Debugging

* Debugging

* Change method for detecting changed files

* Try building before calling spotless

* Update java-autoformat.yml

* Update java-autoformat.yml

* Update java-autoformat.yml

* Purposely bad formatting

Purposely adding some bad formatting to see if the auto-formatter triggers

* Update build.gradle

Disabling Checkstyle in build so the auto-formatter can trigger

* Update java-autoformat.yml

Have auto-formatter trigger when more commits are added to a pull request

* Debugging

* Adding more awful formatting

* Update java-autoformat.yml

* Changing repo URL

* Going back to checkout v1

* Trying URL change

* Trying out using env

* Trying this now...?

* Introducing more horrible changes

* Spotless formatting using google format v1.19.2

* Manual formatting fix

* Automated Java code formatting changes

* Different format type

Trying to get it to pass checkstyle

* Disable checkstyle temporarily

* Automated Java code formatting changes

* Default google formatting style

* Automated Java code formatting changes

* Comments and reordering styles

* Adding extra newlines

* Automated Java code formatting changes

* Changing tabs from 2 to 4 spaces

Supposedly the only difference that aosp makes is the 2 spaces?
Hopefully it doesn't break anything else

* Remove solo } requirement and reactivate checkstyle

* Automated Java code formatting changes

* Update checkstyle.xml

Removed problematic LeftCurly and RightCurly requirements

* Changing back to tabWidth

* Add newline to test formatter + build

* Automated Java code formatting changes

* Trying some ChatGPT stuff

* Getting rid of problematic experimentation

---------

Co-authored-by: Bram van Heuveln <[email protected]>
Co-authored-by: Charles Tian <[email protected]>
Co-authored-by: charlestian23 <[email protected]>

* Java21 (#714)

* Fixed Short Truth Table case rule bug (#707)

* Revert "Bugfix 549 (#682)"

This reverts commit 5048ee69d958fdde9b1bb35854c56c9920068346.

* Case rule test fix (#705)

Co-authored-by: Chase Grajeda <[email protected]>

* Rapid fix for STT case rules

Case rules broke at some point from legacy code or merge conflict. Provided is a quick fix in CaseRule and CaseRule_Generic

* Revert "Revert "Bugfix 549 (#682)"" (#706)

This reverts commit e9fe310378721aa4b4fa358aa57ec44f21d086c1.

---------

Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>

* Change Java version to 21 and setup JPackage to bundle Java with the app

* Setup gradle action for java 21

* Fix distribution in gradle.yml

* Fix java version in tests

* Fix java distribution in tests

* Add jpackage task

* Add Linux to jpackage task

* Fix jpackage task

* Add java setup to jpackage tasks

* Separate build into separate tasks for different operating systems

* Fix mac jpackage not working and changed names of artifacts

* Potential macos installer build fix

* Potential macos installer build fix attempt 2

* Potential macos installer build fix attempt 3

* Add quotes around executable name for macos installer

* Add logo and shortcut prompt

* Update version in build.gradle

* Make installer name different to app (It's a weird way to do it, it renames the file in a gradle task).

* Update java-autoformat.yml

Added check to make sure the pull request is not from a fork

---------

Co-authored-by: Charles Tian <[email protected]>
Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>
Co-authored-by: charlestian23 <[email protected]>

* Update build.gradle (#741)

* Update build.gradle

Fixing the deprecation issues in the autoformatter

* Update build.gradle

* Update build.gradle

* Update to use Java 21

* Automated Java code formatting changes

---------

Co-authored-by: Bram van Heuveln <[email protected]>

* Updating to version 6.0.0

Changing to 6.0.0 since Java upgrade may break backwards compatibility

* Importer written

First draft of the importer written and setData refactored

* small bug fixes

* Added Puzzle Factory and Importer

Refactored a bunch of code so we now (in theory) import correctly

* Delete ThermometerExporter.java

* Added Thermometer to Config file

* Added necessary code to constructor

* Messing with Rule Recognition

* Fixing desyncs in repo

* More syncing and organizing files

* Small misc improvements

Further work on getting a file to open without errors

* Fixed verify vial method

* More work towards visual display

we now have semi working tials!

* Update ThermometerElementView.java

* Rotating images!!!!!

* Added in placeable elements

* Stabilizing bug fixes

* Import silliness

---------

Co-authored-by: Charles Tian <[email protected]>
Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>
Co-authored-by: ThisMatt <[email protected]>
Co-authored-by: ThisMatt <[email protected]>
Co-authored-by: Jaden Tian <[email protected]>
Co-authored-by: Bram van Heuveln <[email protected]>
Co-authored-by: charlestian23 <[email protected]>
Co-authored-by: Fisher Luba <[email protected]>
Co-authored-by: Fuzzabee <[email protected]>

* Final Images + Rule file expansion pack (#795)

* Thermometer Cleanup and debugging

* Major Bug Fix (#798)

* Working row/col numbers (#799)

* Early Work for displaying nums

* Work towards displaying numbers

* Working row/col Numbers

* Thermometer (#801)

* Found bug in name of ThermometerTooLarge.png which was throwing errors and not showing up in LEGUP.

* Added documentation comments to rules

* Updated controller to have correct mouse buttons as well as added debug info with middle mouse. Cleaned up a few methods in TheremomterCell as well.

* Fixed ThermomterExporter to allow saving to write correctly to file.

* Thermometer (#807)

* Found bug in name of ThermometerTooLarge.png which was throwing errors and not showing up in LEGUP.

* Added documentation comments to rules

* Updated controller to have correct mouse buttons as well as added debug info with middle mouse. Cleaned up a few methods in TheremomterCell as well.

* Fixed ThermomterExporter to allow saving to write correctly to file.

* Updated therm_text.xml as row/col was reversed. Also updated some comments on Thermometer and ThermometerExporter

* Last minute comments (#810)

* Final Marcus pull (#814)

* Update ThermometerBoard.java

* Created element files

* Element/rule images

* Too many mercury 1st draft

* Too few mercury contradiction rule

* error fixes

* misc cleanup

* Starting on case rules

* Rest is Empty direct rule and getHead for vials

* Prior is filled rule and getTail functionality

* Prior filled small fix

* Retrofit because I forgot to merge for 2 weeks

* Rest empty quick fix

* Images with thicker lines/orientations

* New more visible rule images

* small addition

* Rule Stubs

* Final rule images

* Major Bug Fix

Zevs actually so dumb lol

* Right Click works now

* Reference Sheet Fill-out

* Update therm_test.xml

* final final rule image

* small comments

* comments

* Automated Java code formatting changes

* Automated Java code formatting changes

* Update config

---------

Co-authored-by: ZevCe <[email protected]>
Co-authored-by: Fuzzabee <[email protected]>
Co-authored-by: ZevCe <[email protected]>
Co-authored-by: Charles Tian <[email protected]>
Co-authored-by: Chase-Grajeda <[email protected]>
Co-authored-by: Chase Grajeda <[email protected]>
Co-authored-by: ThisMatt <[email protected]>
Co-authored-by: ThisMatt <[email protected]>
Co-authored-by: Jaden Tian <[email protected]>
Co-authored-by: Bram van Heuveln <[email protected]>
Co-authored-by: charlestian23 <[email protected]>
Co-authored-by: Fisher Luba <[email protected]>
Co-authored-by: James Baker <[email protected]>
  • Loading branch information
14 people authored May 5, 2024
1 parent d68859b commit 9b46ce7
Show file tree
Hide file tree
Showing 110 changed files with 2,341 additions and 8 deletions.
27 changes: 27 additions & 0 deletions puzzles files/thermometer/therm_test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Legup version="5.1.0">
<puzzle name="Thermometer">
<board height="4" width="4">
<vials>
<vial headx="0" heady="0" tailx="2" taily="0"/>
<vial headx="3" heady="0" tailx="3" taily="3"/>
<vial headx="0" heady="1" tailx="1" taily="1"/>
<vial headx="2" heady="1" tailx="2" taily="3"/>
<vial headx="0" heady="3" tailx="0" taily="2"/>
<vial headx="1" heady="2" tailx="1" taily="3"/>
</vials>
<rowNumbers>
<row value="2"/>
<row value="4"/>
<row value="2"/>
<row value="1"/>
</rowNumbers>
<colNumbers>
<col value="3"/>
<col value="2"/>
<col value="2"/>
<col value="2"/>
</colNumbers>
</board>
</puzzle>
</Legup>
56 changes: 56 additions & 0 deletions src/main/java/edu/rpi/legup/puzzle/thermometer/Thermometer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package edu.rpi.legup.puzzle.thermometer;

import edu.rpi.legup.model.Puzzle;
import edu.rpi.legup.model.gameboard.Board;

// basically just copy-pasted from dev guide on wiki
public class Thermometer extends Puzzle {
public Thermometer() {
super();

this.name = "Thermometer";

this.importer = new ThermometerImporter(this);
this.exporter = new ThermometerExporter(this);
// we do not have a thermometerCellFactory class as
// thermometerVial has its own thermometerCell factory method
}

/** Initializes the game board. Called by the invoker of the class */
@Override
public void initializeView() {
boardView = new ThermometerView((ThermometerBoard) 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;
}

/**
* 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) {
return true;
}

/**
* Callback for when the board puzzleElement changes
*
* @param board the board that has changed
*/
@Override
public void onBoardChange(Board board) {}
}
139 changes: 139 additions & 0 deletions src/main/java/edu/rpi/legup/puzzle/thermometer/ThermometerBoard.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
package edu.rpi.legup.puzzle.thermometer;

import edu.rpi.legup.model.gameboard.GridBoard;
import java.awt.*;
import java.util.ArrayList;

public class ThermometerBoard extends GridBoard {

// an array containing all of our vials on the board
private ArrayList<ThermometerVial> thermometerVials;

// representations of the number requirements along rows and columns of the board
// we use rotation to store the number
private ArrayList<ThermometerCell> colNumbers;
private ArrayList<ThermometerCell> rowNumbers;

private ThermometerCell dummyCell;

// constructors for the boards and variables
public ThermometerBoard(int width, int height) {
super(width, height);

// initializing the row/col number arrays with zeros, so they can be
// easily updated using the setRow/ColNumber functions
colNumbers = new ArrayList<>();
for (int i = 0; i < width - 1; i++) {
ThermometerCell cell =
new ThermometerCell(
new Point(i, height - 1),
ThermometerType.UNKNOWN,
ThermometerFill.UNKNOWN,
0);
cell.setIndex((height - 1) * height + i);
colNumbers.add(cell);
this.setCell(i, height - 1, cell);
}
rowNumbers = new ArrayList<>();
for (int i = 0; i < height - 1; i++) {
ThermometerCell cell =
new ThermometerCell(
new Point(width - 1, i),
ThermometerType.UNKNOWN,
ThermometerFill.UNKNOWN,
0);
cell.setIndex(i * height + (width - 1));
rowNumbers.add(cell);
this.setCell(width - 1, i, cell);
}

// setting a dummy cell so board doesn't have null cells
dummyCell =
new ThermometerCell(
new Point(width - 1, height - 1),
ThermometerType.UNKNOWN,
ThermometerFill.UNKNOWN,
-1);
dummyCell.setIndex((height - 1) * height + width);
this.setCell(width - 1, height - 1, dummyCell);

// creating our empty vial of thermometers to add to
thermometerVials = new ArrayList<>();
}

// setters and accessors for our array of vials
public void addVial(ThermometerVial v) {
thermometerVials.add(v);
}

public ArrayList<ThermometerVial> getVials() {
return thermometerVials;
}

// our setters for row/col numbers with simple input verification
public boolean setRowNumber(int row, int num) {
// first check is to verify we are updating an element in range
// second check is to verify the new number can be achieved by the puzzle
if (row < rowNumbers.size() && num <= colNumbers.size()) {
rowNumbers.get(row).setRotation(num);
return true;
}
return false;
}

public boolean setColNumber(int col, int num) {
// first check is to verify we are updating an element in range
// second check is to verify the new number can be achieved by the puzzle
if (col < colNumbers.size() && num <= rowNumbers.size()) {
colNumbers.get(col).setRotation(num);
return true;
}
return false;
}

// basic accessors for row/col numbers
public int getRowNumber(int row) {
if (row < 0 || row >= rowNumbers.size()) return -1;
return rowNumbers.get(row).getRotation();
}

public int getColNumber(int col) {
if (col < 0 || col >= rowNumbers.size()) return -1;
return colNumbers.get(col).getRotation();
}

// Accessors for saving row/column
public ArrayList<ThermometerCell> getRowNumbers() {
return rowNumbers;
}

public ArrayList<ThermometerCell> getColNumbers() {
return colNumbers;
}

// we all suck at programming so instead of using provided array list
// we use our own array lists to keep track of the vials
// marginally useful because it means we are guaranteed to get a
// thermometer cell when calling get cell, but using some type casting
// this override function could very likely be refactored out
@Override
public ThermometerCell getCell(int x, int y) {
for (ThermometerVial vial : this.thermometerVials) {
for (ThermometerCell cell : vial.getCells()) {
if (cell.getLocation().x == x && cell.getLocation().y == y) return cell;
}
}

for (ThermometerCell cell : rowNumbers) {
if (cell.getLocation().x == x && cell.getLocation().y == y) return cell;
}

for (ThermometerCell cell : colNumbers) {
if (cell.getLocation().x == x && cell.getLocation().y == y) return cell;
}

if (x == this.getWidth() - 1 && y == this.getHeight() - 1) return dummyCell;

return null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
package edu.rpi.legup.puzzle.thermometer;

import edu.rpi.legup.model.gameboard.GridCell;
import java.awt.Point;

public class ThermometerCell extends GridCell<Integer> {

// information about the cell needed to display it
private ThermometerType type;
private ThermometerFill fill;
private int rotation;

public ThermometerCell(Point location, ThermometerType t, ThermometerFill f, int r) {
// since we do not use get/set data value int can be any value
super(1, location);
type = t;
fill = f;
rotation = r;
}

// Note: setdata does not work for our purposes
public void setType(ThermometerType t) {
type = t;
}

public ThermometerType getType() {
return type;
}

public void setFill(ThermometerFill f) {
fill = f;
}

public ThermometerFill getFill() {
return fill;
}

public void setRotation(int r) {
rotation = r;
}

public int getRotation() {
return rotation;
}

@Override
public ThermometerCell copy() {
ThermometerCell copy =
new ThermometerCell((Point) location.clone(), this.type, this.fill, this.rotation);
copy.setIndex(index);
copy.setModifiable(isModifiable);
copy.setGiven(isGiven);
return copy;
}

@Override
public String toString() {
return "("
+ location.getX()
+ ", "
+ location.getY()
+ ") TYPE = "
+ getType()
+ " FILL = "
+ getFill();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package edu.rpi.legup.puzzle.thermometer;

import edu.rpi.legup.controller.ElementController;
import edu.rpi.legup.model.gameboard.PuzzleElement;
import java.awt.event.MouseEvent;

public class ThermometerController extends ElementController {

// method for updating thermometer cells since number cells have unknown for
// their fill type we don't need to worry about end user modifying them with this
@Override
public void changeCell(MouseEvent e, PuzzleElement data) {
ThermometerCell cell = (ThermometerCell) data;

if (e.getButton() == MouseEvent.BUTTON1) {
if (e.isControlDown()) {
this.boardView
.getSelectionPopupMenu()
.show(
boardView,
this.boardView.getCanvas().getX() + e.getX(),
this.boardView.getCanvas().getY() + e.getY());
} else {
if (cell.getFill() == ThermometerFill.EMPTY) {
cell.setFill(ThermometerFill.FILLED);
} else if (cell.getFill() == ThermometerFill.FILLED) {
cell.setFill(ThermometerFill.BLOCKED);
} else {
cell.setFill(ThermometerFill.EMPTY);
}
}
} else if (e.getButton() == MouseEvent.BUTTON3) {
if (cell.getFill() == ThermometerFill.EMPTY) {
cell.setFill(ThermometerFill.BLOCKED);
} else if (cell.getFill() == ThermometerFill.BLOCKED) {
cell.setFill(ThermometerFill.FILLED);
} else {
cell.setFill(ThermometerFill.EMPTY);
}
} else if (e.getButton() == MouseEvent.BUTTON2) {
System.out.println("[DEBUG] " + cell);
}
}
}
Loading

0 comments on commit 9b46ce7

Please sign in to comment.