refactored ceremony message
This commit is contained in:
@@ -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.
|
||||||
|
|||||||
@@ -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