Skip to content

Commit

Permalink
refactor: Include winRatio property
Browse files Browse the repository at this point in the history
  • Loading branch information
BeckFW committed Mar 18, 2024
1 parent 700b8d7 commit e6f7f04
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ class MiniGameService : EngineService() {
startMiniGame(RandomOccurrenceView(miniGame)) { callback.accept(it) }
}

fun startTriggerSequence(keys: List<KeyCode>, callback: Consumer<TriggerSequenceResult>) {
val miniGame = TriggerSequenceMiniGame()
fun startTriggerSequence(keys: List<KeyCode>, winRatio: Double, callback: Consumer<TriggerSequenceResult>) {
val miniGame = TriggerSequenceMiniGame(winRatio)
miniGame.triggers += keys.map { KeyTrigger(it) }

startMiniGame(TriggerSequenceView(miniGame)) { callback.accept(it) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected void initGame() {

var btn1 = new Button("Trigger Sequence");
btn1.setOnAction(e -> {
getMiniGameService().startTriggerSequence(List.of(S, F, A), result -> {
getMiniGameService().startTriggerSequence(List.of(S, F, A), 1.0, result -> {
debugText.setText(result.isSuccess() ? "Success" : "Fail");
});
});
Expand Down

0 comments on commit e6f7f04

Please sign in to comment.