diff --git a/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/minigames/GameGimmick.java b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/minigames/GameGimmick.java new file mode 100644 index 0000000..e1add25 --- /dev/null +++ b/src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/minigames/GameGimmick.java @@ -0,0 +1,30 @@ +package edu.ntnu.idi.idatt2003.g40.mappe.view.widgets.minigames; + +import java.util.function.IntConsumer; +import javafx.scene.Node; + +/** + * Strategy interface defining the central + * logic and layout for individual minigames. + */ +public interface GameGimmick { + + /** + * Getter method for JavaFx root element of this gimmick. + * + * @return This games root as a {@link Node} + */ + Node getCanvasNode(); + + /** + * Initializes the game behavior, wiring score changes back to the engine. + * + * @param scoreModifier Callback function to adjust the global score. + */ + void initialize(IntConsumer scoreModifier); + + /** + * Called on every frame tick (or second) by the main game loop. + */ + void updateTick(); +}