Merge branch 'development' into 'dev/test'
merge changes into the testbranch See merge request progproj/gruppen-ht24/Gruppe-01!14
This commit was merged in pull request #14.
This commit is contained in:
@@ -7,4 +7,8 @@ public Dialogs(ClientState parent, ClientGameLogic logic) {
|
|||||||
super(parent, logic);
|
super(parent, logic);
|
||||||
this.dialogsStateMachine = new DialogsStateMachine(parent, logic);
|
this.dialogsStateMachine = new DialogsStateMachine(parent, logic);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DialogsStateMachine getDialogsStateMachine() {
|
||||||
|
return dialogsStateMachine;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,11 +6,11 @@
|
|||||||
* A message sent by the server to indicate the beginning of the ceremony.
|
* A message sent by the server to indicate the beginning of the ceremony.
|
||||||
*/
|
*/
|
||||||
@Serializable
|
@Serializable
|
||||||
public class Ceremony extends ServerMessage {
|
public class CeremonyMessage extends ServerMessage {
|
||||||
/**
|
/**
|
||||||
* Constructs a new Ceremony instance.
|
* Constructs a new Ceremony instance.
|
||||||
*/
|
*/
|
||||||
public Ceremony() {
|
public CeremonyMessage() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ public interface ServerInterpreter {
|
|||||||
*
|
*
|
||||||
* @param msg the Ceremony message received
|
* @param msg the Ceremony message received
|
||||||
*/
|
*/
|
||||||
void received(Ceremony msg);
|
void received(CeremonyMessage msg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles a Dice message received from the server.
|
* Handles a Dice message received from the server.
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public void receivedRequestDice(RequestDice msg, int from) {
|
|||||||
@Override
|
@Override
|
||||||
public void update() {
|
public void update() {
|
||||||
if (Boolean.TRUE.equals(logic.getGame().allRanked())) {
|
if (Boolean.TRUE.equals(logic.getGame().allRanked())) {
|
||||||
broadcastUpdate(new RankingResponce());
|
broadcastUpdate(new RankingResponse());
|
||||||
if (logic.getGame().getOrder().isEmpty()) {
|
if (logic.getGame().getOrder().isEmpty()) {
|
||||||
// todo: save the players with the same value?
|
// todo: save the players with the same value?
|
||||||
broadcastUpdate(new RankingRollAgain());
|
broadcastUpdate(new RankingRollAgain());
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import pp.mdga.message.client.*;
|
import pp.mdga.message.client.*;
|
||||||
import pp.mdga.message.server.PauseGame;
|
import pp.mdga.message.server.PauseGame;
|
||||||
import pp.mdga.message.server.PossibleCard;
|
import pp.mdga.message.server.PossibleCard;
|
||||||
import pp.mdga.message.server.RankingResponce;
|
import pp.mdga.message.server.RankingResponse;
|
||||||
|
|
||||||
public class GameState extends ServerState {
|
public class GameState extends ServerState {
|
||||||
private final GameStateMachine gameStateMachine = new GameStateMachine(this, logic);
|
private final GameStateMachine gameStateMachine = new GameStateMachine(this, logic);
|
||||||
@@ -54,7 +54,7 @@ public void sentPossibleCard(PossibleCard msg, int from) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sentRankingResponse(RankingResponce msg, int from) {
|
public void sentRankingResponse(RankingResponse msg, int from) {
|
||||||
gameStateMachine.sentRankingResponse(msg, from);
|
gameStateMachine.sentRankingResponse(msg, from);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
import pp.mdga.message.client.*;
|
import pp.mdga.message.client.*;
|
||||||
import pp.mdga.message.server.EndOfTurn;
|
import pp.mdga.message.server.EndOfTurn;
|
||||||
import pp.mdga.message.server.PossibleCard;
|
import pp.mdga.message.server.PossibleCard;
|
||||||
import pp.mdga.message.server.RankingResponce;
|
import pp.mdga.message.server.RankingResponse;
|
||||||
import pp.mdga.message.server.ServerMessage;
|
import pp.mdga.message.server.ServerMessage;
|
||||||
|
|
||||||
import java.lang.System.Logger;
|
import java.lang.System.Logger;
|
||||||
@@ -152,7 +152,7 @@ public void sentPossibleCard(PossibleCard msg, int from) { /* do nothing */ }
|
|||||||
*
|
*
|
||||||
* @param msg the RankingResponce message
|
* @param msg the RankingResponce message
|
||||||
*/
|
*/
|
||||||
public void sentRankingResponse(RankingResponce msg, int from) { /* do nothing */ }
|
public void sentRankingResponse(RankingResponse msg, int from) { /* do nothing */ }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method transitions to a new state.
|
* This method transitions to a new state.
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import pp.mdga.message.client.*;
|
import pp.mdga.message.client.*;
|
||||||
import pp.mdga.message.server.EndOfTurn;
|
import pp.mdga.message.server.EndOfTurn;
|
||||||
import pp.mdga.message.server.PossibleCard;
|
import pp.mdga.message.server.PossibleCard;
|
||||||
import pp.mdga.message.server.RankingResponce;
|
import pp.mdga.message.server.RankingResponse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstract class representing a state machine for the server.
|
* Abstract class representing a state machine for the server.
|
||||||
@@ -209,7 +209,7 @@ public void sentPossibleCard(PossibleCard msg, int from) {
|
|||||||
* @param msg the RankingResponse message
|
* @param msg the RankingResponse message
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void sentRankingResponse(RankingResponce msg, int from) {
|
public void sentRankingResponse(RankingResponse msg, int from) {
|
||||||
state.sentRankingResponse(msg, from);
|
state.sentRankingResponse(msg, from);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
package pp.mdga.server;
|
package pp.mdga.server;
|
||||||
|
|
||||||
import pp.mdga.client.Spectator;
|
|
||||||
import pp.mdga.game.Player;
|
import pp.mdga.game.Player;
|
||||||
import pp.mdga.message.server.ActivePlayer;
|
import pp.mdga.message.server.ActivePlayer;
|
||||||
import pp.mdga.message.server.Ceremony;
|
import pp.mdga.message.server.CeremonyMessage;
|
||||||
import pp.mdga.message.server.EndOfTurn;
|
|
||||||
|
|
||||||
public class Turn extends ServerState {
|
public class Turn extends ServerState {
|
||||||
private final TurnStateMachine turnStateMachine = new TurnStateMachine(this, logic);
|
private final TurnStateMachine turnStateMachine = new TurnStateMachine(this, logic);
|
||||||
@@ -25,7 +23,7 @@ public void exit() {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
if (logic.getGame().getPlayers().size() == 1) {
|
if (logic.getGame().getPlayers().size() == 1) {
|
||||||
broadcastUpdate(new Ceremony());
|
broadcastUpdate(new CeremonyMessage());
|
||||||
this.getParent().getParent().exit();
|
this.getParent().getParent().exit();
|
||||||
} else {
|
} else {
|
||||||
// todo: next player
|
// todo: next player
|
||||||
|
|||||||
Reference in New Issue
Block a user