mirror of
https://github.com/2OOP/pism.git
synced 2026-02-04 19:04:49 +00:00
Collapsed interfaces in Controller section
This commit is contained in:
@@ -1,9 +1,8 @@
|
|||||||
package org.toop.framework.gameFramework.controller;
|
package org.toop.framework.gameFramework.controller;
|
||||||
|
|
||||||
import org.toop.framework.gameFramework.model.game.threadBehaviour.Controllable;
|
|
||||||
import org.toop.framework.networking.connection.events.NetworkEvents;
|
import org.toop.framework.networking.connection.events.NetworkEvents;
|
||||||
|
|
||||||
public interface GameController extends Controllable, UpdatesGameUI {
|
public interface GameController {
|
||||||
/** Called when it is this player's turn to make a move. */
|
/** Called when it is this player's turn to make a move. */
|
||||||
void onYourTurn(NetworkEvents.YourTurnResponse event);
|
void onYourTurn(NetworkEvents.YourTurnResponse event);
|
||||||
|
|
||||||
@@ -13,5 +12,12 @@ public interface GameController extends Controllable, UpdatesGameUI {
|
|||||||
/** Called when the game has finished, with the final result. */
|
/** Called when the game has finished, with the final result. */
|
||||||
void gameFinished(NetworkEvents.GameResultResponse event);
|
void gameFinished(NetworkEvents.GameResultResponse event);
|
||||||
|
|
||||||
|
void start();
|
||||||
|
|
||||||
|
void stop();
|
||||||
|
|
||||||
|
/** Called to refresh or update the game UI. */
|
||||||
|
void updateUI();
|
||||||
|
|
||||||
void sendMove(long clientId, long move);
|
void sendMove(long clientId, long move);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
package org.toop.framework.gameFramework.controller;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Interface for classes that can trigger a UI update.
|
|
||||||
*/
|
|
||||||
public interface UpdatesGameUI {
|
|
||||||
|
|
||||||
/** Called to refresh or update the game UI. */
|
|
||||||
void updateUI();
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
package org.toop.framework.gameFramework.model.game.threadBehaviour;
|
|
||||||
|
|
||||||
public interface Controllable {
|
|
||||||
void start();
|
|
||||||
|
|
||||||
void stop();
|
|
||||||
}
|
|
||||||
@@ -11,8 +11,11 @@ import java.util.function.Consumer;
|
|||||||
* <p>
|
* <p>
|
||||||
* Defines how a game's execution is started, stopped, and which player is active.
|
* Defines how a game's execution is started, stopped, and which player is active.
|
||||||
*/
|
*/
|
||||||
public interface ThreadBehaviour extends Controllable {
|
public interface ThreadBehaviour {
|
||||||
void setOnUpdateUI(Runnable onUpdateUI);
|
void setOnUpdateUI(Runnable onUpdateUI);
|
||||||
void setOnSendMove(LongPairConsumer onSendMove);
|
void setOnSendMove(LongPairConsumer onSendMove);
|
||||||
|
void start();
|
||||||
|
void stop();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user