- GUI (phases 7-8): BuilderScreen, Panel, NumberSlider, CycleButton, BuilderUi keybinds (Right Shift menu, P pause macro), lang entries, README - ConfigStore.loadOrEmpty/saveQuietly; BuildSettings.Range; BuilderFeature settings()/stage()/togglePause() - Checks: ~60 Checkstyle rules (errors), PMD with 7 categories, checkArchitecture (layer rules + max 4 files per package, with baseline), javac -Xlint:all -Werror, rule rejecting non-English comments - File length limit raised to 250 lines - License: GPL-3.0-only (LICENSE, fabric.mod.json) - All code comments and log messages translated to English
21 lines
653 B
Java
21 lines
653 B
Java
package dev.loki.satura.interaction.click;
|
|
|
|
import java.util.function.BooleanSupplier;
|
|
import java.util.function.Consumer;
|
|
|
|
/**
|
|
* A single container click.
|
|
*
|
|
* @param click click action (the clickSlot call)
|
|
* @param confirmed true when the click result is visible in the slots (sync arrived)
|
|
* @param onDone task outcome
|
|
*/
|
|
public record ClickTask(Runnable click, BooleanSupplier confirmed, Consumer<Outcome> onDone) {
|
|
|
|
/** Task outcome. */
|
|
public enum Outcome { CONFIRMED, FAILED }
|
|
|
|
public static ClickTask of(Runnable click, BooleanSupplier confirmed) {
|
|
return new ClickTask(click, confirmed, outcome -> { });
|
|
}
|
|
}
|