Skip to content

Commit

Permalink
Feat: Added GameGimmick interface
Browse files Browse the repository at this point in the history
The interface will function as a content replacement option in the Strategy principle.
  • Loading branch information
tommyah committed May 23, 2026
1 parent eacb103 commit 625bbf5
Showing 1 changed file with 30 additions and 0 deletions.
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();
}

0 comments on commit 625bbf5

Please sign in to comment.