Skip to content

Commit

Permalink
Merge pull request #53 from Ultraviolet-Ninja/dev
Browse files Browse the repository at this point in the history
Update Cycle
  • Loading branch information
Ultraviolet-Ninja authored Feb 23, 2023
2 parents ef9882f + c34460b commit 637e6b3
Show file tree
Hide file tree
Showing 122 changed files with 1,759 additions and 636 deletions.
1 change: 0 additions & 1 deletion .github/workflows/publish_executables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ jobs:
run: ./gradlew releaseToGitHub -PauthToken=${{ secrets.GITHUB_TOKEN }}

linux-pipeline:

runs-on: ubuntu-latest
needs: windows-pipeline

Expand Down
2 changes: 1 addition & 1 deletion Learned.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Another thing we talked about while he was on the project was moving back to Jav
- Using the build.gradle file to organize dependencies and plugins, facilitate testing, set up distributions in zip and tar files, and releases for GitHub.
- Making custom tasks and using parameters for CI pipelines to test certain parts of the code.
- Automating tests with CircleCI using this [video](https://www.youtube.com/watch?v=9PgZCJNzY9M) as a guide.
- Coming across ~~LGTM~~ (when it was still around) and taking advantage of its code quality checking for flaws in my Java code.
- Coming across ~~LGTM~~ (_when it was still around_) Codacy and taking advantage of its code quality checking for flaws in my Java code.
## Graphs and their Algorithms
- Creating graphs by looking up the concept or using the JGraphT library.
- Making use of Dijkstra's Shortest Path and A* to solve different problems.
Expand Down
8 changes: 4 additions & 4 deletions Progress.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
### Finished Modules
- Alphabet
- Astrology
- Battleship
- Bitwise Ops
- Blind Alley
- Boolean Venn Diagram
- Chess
- Chord Qualities
- Colored Switches (Not technically part of the bomb, but was a fun ~~recursion~~ graph problem using A*)
- Colored Switches (Not technically part of the bomb, but was a fun ~~recursion~~ graph problem using ~~A*~~ Dijkstra's)
- Emoji Math
- Fast Math
- Forget Me Not
Expand All @@ -23,10 +24,9 @@
- The Bulb
- TwoBit

22/100
23/100

### Incomplete Modules
- Battleship
- Caesar Cipher
- Cheap Checkout
- Color Flash
Expand All @@ -39,7 +39,7 @@
- Square Button
- Word Search

12/100
11/100

### Untouched Modules
- 3D Maze
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
*101 modules, 100 minutes, exponentially more problems.*

[![CircleCI](https://circleci.com/gh/Ultraviolet-Ninja/GradleCenturion/tree/main.svg?style=shield)](https://circleci.com/gh/Ultraviolet-Ninja/GradleCenturion/tree/main)
![Project Version](https://img.shields.io/badge/version-0.22.3.1-blueviolet)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/b4b8571475d543a2afc720f5f96ae2cf)](https://www.codacy.com/gh/Ultraviolet-Ninja/GradleCenturion/dashboard?utm_source=github.com&utm_medium=referral&utm_content=Ultraviolet-Ninja/GradleCenturion&utm_campaign=Badge_Grade)
![Project Version](https://img.shields.io/badge/version-0.23.0-blueviolet)

## Intro
This project is designed to solve all puzzles found on the Centurion Bomb from Keep Talking and Nobody Explodes, which is a combination of many community-made puzzles and some from the base game set in different languages.<br>
Expand Down Expand Up @@ -32,7 +33,7 @@ See the running list of modules [here](Progress.md)
## How to run the program
*Disclaimer*: This is referring to program versions `0.22.2` onward
- The `source code` option of the [Release Page](https://github.com/Ultraviolet-Ninja/GradleCenturion/releases) contains an executable, a Windows batch file and all the necessary jar files to run the program
- The `Gradle-Centurion-[VERSION]-[OPERATING SYSTEM]` contains a OS-specific executable file with a runtime environment for the program to run in
- The `Gradle-Centurion-[VERSION]-[OPERATING SYSTEM]` contains an OS-specific executable file with a runtime environment for the program to run in
- *Only supports Windows currently*

## Inspiration
Expand Down
12 changes: 5 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@ plugins {
id 'java'
id 'jacoco'
id 'application'
id 'org.beryx.jlink' version '2.25.0'
id 'org.beryx.jlink' version '2.26.0'
id 'info.solidsoft.pitest' version '1.7.4'
id 'org.openjfx.javafxplugin' version '0.0.13'
id 'org.javamodularity.moduleplugin' version '1.8.12'
id 'com.github.breadmoirai.github-release' version '2.4.1'
// Another packing plugin to "check out"
// id "io.ktor.plugin" version "2.2.1"
}

group 'jasmine.jragon'
version '0.22.3.1'
version '0.23.0'

java {
sourceCompatibility(17)
Expand Down Expand Up @@ -47,7 +45,7 @@ dependencies {
implementation 'com.opencsv:opencsv:5.7.1'
implementation 'org.javatuples:javatuples:1.2'
implementation 'org.jgrapht:jgrapht-ext:1.5.1'
implementation 'org.jetbrains:annotations:23.1.0'
implementation 'org.jetbrains:annotations:24.0.0'
//implementation 'io.github.fvarrui:javpackager:1.5.1'

implementation('com.jfoenix:jfoenix:9.0.4') {
Expand All @@ -57,10 +55,10 @@ dependencies {
exclude group: "org.javafx"
}

testImplementation 'org.testng:testng:7.7.0'
testImplementation 'org.testng:testng:7.7.1'
testImplementation 'org.slf4j:slf4j-api:2.0.6'
testImplementation 'org.slf4j:slf4j-simple:2.0.6'
testImplementation 'nl.jqno.equalsverifier:equalsverifier:3.12.3'
testImplementation 'nl.jqno.equalsverifier:equalsverifier:3.13.2'
}

def firstInstance = project.hasProperty('thread0')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import java.util.ArrayList;
import java.util.List;

public class HexamazeController implements Resettable {
public final class HexamazeController implements Resettable {
@FXML
private ToggleGroup hexGroup, hexColorGroup;

Expand Down
11 changes: 11 additions & 0 deletions jlink-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
jlink \
--module-path src/main/java \
--output base-layer \
#--add-modules java.base,javafx.controls,javafx.fxml,\
#opencsv,commons-lang3 \

#--compress=2 \
#--no-header-files \
#--no-man-pages \
#--strip-debug
2 changes: 2 additions & 0 deletions jpackage-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
jpackage
16 changes: 10 additions & 6 deletions src/main/java/bomb/ManualController.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
import static java.util.stream.Collectors.toMap;

@SuppressWarnings("ConstantConditions")
public class ManualController {
public final class ManualController {
//TODO - Remove when every FXML file is being used
private static final Region EMPTY_VIEW;

Expand Down Expand Up @@ -106,12 +106,12 @@ private CompletableFuture<Map<Toggle, Region>> setupRegionMap() {
ResetObserver resetObserver = new ResetObserver();
ObserverHub.addObserver(RESET, resetObserver);
var fxmlMapFuture = supplyAsync(() -> createFXMLMap(resetObserver));
var radioButtonNameFuture = createRadioButtonNameFuture(options.getToggles());
var radioButtonNameFuture = createButtonNameFuture(options.getToggles());

return radioButtonNameFuture.thenCombine(fxmlMapFuture, ManualController::createRegionMap);
}

private static CompletableFuture<Map<String, Toggle>> createRadioButtonNameFuture(List<Toggle> radioButtonList) {
private static CompletableFuture<Map<String, Toggle>> createButtonNameFuture(List<Toggle> radioButtonList) {
return supplyAsync(radioButtonList::stream)
.thenApply(stream -> stream.collect(toMap(
GET_TOGGLE_NAME,
Expand All @@ -133,9 +133,13 @@ private static Map<Toggle, Region> createRegionMap(Map<String, Toggle> radioButt
}

private static Map<String, Region> createFXMLMap(ResetObserver resetObserver) {
return getDisplayedClasses()
// .stream()
.parallelStream()
var displayClassStream = getDisplayedClasses().parallelStream();

if (System.getProperty("os.name").toLowerCase().contains("linux")) {
displayClassStream = displayClassStream.sequential();
}

return displayClassStream
.map(cls -> mapClassToRegion(cls, resetObserver))
.collect(toMap(Pair::getValue0, Pair::getValue1));
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/bomb/WidgetController.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import static bomb.tools.pattern.observer.ObserverHub.ObserverIndex.RESET;
import static bomb.tools.pattern.observer.ObserverHub.ObserverIndex.SOUVENIR_TOGGLE;

public class WidgetController {
public final class WidgetController {
@FXML
private MFXSlider dviPortSlider, parallelPortSlider, psPortSlider, rjPortSlider,
serialPortSlider, rcaPortSlider;
Expand Down Expand Up @@ -66,9 +66,9 @@ public void initialize() {

private void initializeOtherSliderEvent() {
doubleABatteries.setOnMouseClicked(event -> Widget.setDoubleAs((int) doubleABatteries.getValue()));
dBatteries.setOnMouseClicked(event -> Widget.setDoubleAs((int) dBatteries.getValue()));
batteryHolders.setOnMouseClicked(event -> Widget.setDoubleAs((int) batteryHolders.getValue()));
portPlates.setOnMouseClicked(event -> Widget.setDoubleAs((int) portPlates.getValue()));
dBatteries.setOnMouseClicked(event -> Widget.setDBatteries((int) dBatteries.getValue()));
batteryHolders.setOnMouseClicked(event -> Widget.setNumHolders((int) batteryHolders.getValue()));
portPlates.setOnMouseClicked(event -> Widget.setNumberOfPlates((int) portPlates.getValue()));
}

private void initializePortSliderEvent() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/bomb/abstractions/State.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

@FunctionalInterface
public interface State<T> {
T nextState();
T toNextState();
}
11 changes: 8 additions & 3 deletions src/main/java/bomb/components/chord/NoteCircleComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import java.util.Set;
import java.util.function.Consumer;

public class NoteCircleComponent extends Pane implements Resettable {
public final class NoteCircleComponent extends Pane implements Resettable {
public static final byte SELECTED_NOTE_LIMIT = 4;

private static final String ENABLED_ID = "enabled-light-circle", DISABLED_ID = "disabled-light-circle";
Expand All @@ -31,7 +31,9 @@ public class NoteCircleComponent extends Pane implements Resettable {
noteDSharpLight, noteELight, noteFLight, noteFSharpLight, noteGLight, noteGSharpLight;

@FXML
private MFXButton a, aSharp, b, c, cSharp, d, dSharp, e, f, fSharp, g, gSharp;
private MFXButton noteAButton, noteASharpButton, noteBButton, noteCButton, noteCSharpButton,
noteDButton, noteDSharpButton, noteEButton, noteFButton, noteFSharpButton,
noteGButton, noteGSharpButton;

public NoteCircleComponent() {
super();
Expand All @@ -45,7 +47,10 @@ public NoteCircleComponent() {
}

public void initialize() {
MFXButton[] buttonArray = {a, aSharp, b, c, cSharp, d, dSharp, e, f, fSharp, g, gSharp};
MFXButton[] buttonArray = {noteAButton, noteASharpButton, noteBButton, noteCButton,
noteCSharpButton, noteDButton, noteDSharpButton, noteEButton, noteFButton,
noteFSharpButton, noteGButton, noteGSharpButton};

Circle[] circleArray = {
noteALight, noteASharpLight, noteBLight, noteCLight, noteCSharpLight, noteDLight,
noteDSharpLight, noteELight, noteFLight, noteFSharpLight, noteGLight, noteGSharpLight
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/bomb/components/hex/HexTile.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import static bomb.modules.dh.hexamaze.Hexamaze.COLOR_MAP;
import static bomb.modules.dh.hexamaze.Hexamaze.PEG_COLOR;

public class HexTile extends Pane implements Resettable {
public final class HexTile extends Pane implements Resettable {
public static final Color DEFAULT_BACKGROUND_COLOR = new Color(0.0195, 0.0195, 0.0195, 1.0);

private HexNode internalNode;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/bomb/components/hex/MazeComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import static javafx.scene.paint.Color.RED;
import static javafx.scene.paint.Color.YELLOW;

public class MazeComponent extends Pane implements Resettable {
public final class MazeComponent extends Pane implements Resettable {
private String shapeSelection, colorSelection;
private HexTile playerLocation;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ public abstract class AbstractChipComponent extends Pane {
@FXML
protected Label type, serialNumbers;

public AbstractChipComponent() {
super();
}

public abstract void setColors(List<Color> results);

public void setChipSerialNum(String numbers) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import java.util.List;

public class EightPinController extends AbstractChipComponent {
public final class EightPinController extends AbstractChipComponent {
public static final int PIN_COUNT = 8;

@FXML
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import java.util.List;

public class SixPinController extends AbstractChipComponent {
public final class SixPinController extends AbstractChipComponent {
public static final int PIN_COUNT = 6;

@FXML
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import java.util.List;

public class TenPinController extends AbstractChipComponent {
public final class TenPinController extends AbstractChipComponent {
public static final int PIN_COUNT = 10;

@FXML
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import static javafx.scene.paint.Color.WHITE;

public class CustomEdge extends Polygon implements Resettable {
public final class CustomEdge extends Polygon implements Resettable {
private boolean selectorMode;
private List<CustomEdge> internalReference;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import java.util.List;
import java.util.Set;

public class CustomStar extends Pane implements Resettable {
public final class CustomStar extends Pane implements Resettable {
private final List<CustomEdge> clicks = new ArrayList<>();

@FXML private CustomEdge first, second, third, forth, fifth, sixth;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import javafx.scene.shape.Arc;
import javafx.util.Duration;

public class CustomState extends Pane implements Resettable {
public final class CustomState extends Pane implements Resettable {
@FXML private Arc button;

public CustomState(){
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/bomb/modules/ab/alphabet/AlphabetController.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import static bomb.tools.pattern.factory.TextFormatterFactory.createOneLetterFormatter;
import static javafx.scene.control.Alert.AlertType.ERROR;

public class AlphabetController implements Resettable {
public final class AlphabetController implements Resettable {
private final Map<MFXTextField, MFXTextField> stateMap;

@FXML
Expand Down Expand Up @@ -47,12 +47,13 @@ private EventHandler<KeyEvent> createActionHandler() {
}

private boolean moveToLastEmptyTextField(MFXTextField source) {
MFXTextField tempSource = source;
do {
source = stateMap.get(source);
} while (source != null && !source.getText().isEmpty());
tempSource = stateMap.get(tempSource);
} while (tempSource != null && !tempSource.getText().isEmpty());

if (source != null) {
source.requestFocus();
if (tempSource != null) {
tempSource.requestFocus();
return false;
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import java.util.Arrays;

public class AstrologyController implements Resettable {
public final class AstrologyController implements Resettable {
private final AstrologySymbol[] astrologySymbolBuffer;

@FXML
Expand Down
Loading

0 comments on commit 637e6b3

Please sign in to comment.