-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The interface will function as a content replacement option in the Strategy principle.
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
src/main/java/edu/ntnu/idi/idatt2003/g40/mappe/view/widgets/minigames/GameGimmick.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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(); | ||
| } |