added more logic for the server state diagram

This commit is contained in:
Daniel Grigencha
2024-11-22 09:37:49 +01:00
committed by Felix
parent f3894a5058
commit 6dfb2980fa
20 changed files with 404 additions and 214 deletions

View File

@@ -2,6 +2,7 @@
import pp.mdga.game.Piece;
import pp.mdga.game.Player;
import pp.mdga.message.client.RequestMove;
public class StartPiece extends ServerState {
public StartPiece(ServerState parent, ServerGameLogic logic) {
@@ -9,12 +10,12 @@ public StartPiece(ServerState parent, ServerGameLogic logic) {
}
@Override
public void receivedConfirmPiece(Piece p) {
if (verifyPiece(p)) {
logic.send(new Player(1), new Animation());
// todo: goto state
} else {
logic.send(new Player(1), new pp.mdga.message.server.StartPiece());
}
public void receivedRequestMove(RequestMove msg, int from) {
// if (verifyPiece(p)) {
// logic.send(new Player(1), new Animation());
// // todo: goto state
// } else {
// logic.send(new Player(1), new pp.mdga.message.server.StartPiece());
// }
}
}