recive logic for messages

This commit is contained in:
Johannes Schmelz 2024-11-16 18:03:19 +01:00
parent 627e3dbd7f
commit 628b98af9b
19 changed files with 36 additions and 36 deletions

View File

@ -26,7 +26,6 @@ public class BuyPropertyRequest extends ClientMessage{
@Override
public void accept(ClientInterpreter interpreter, int from) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'accept'");
interpreter.received(this, from);
}
}

View File

@ -6,8 +6,7 @@ public class EndTurn extends ClientMessage{
@Override
public void accept(ClientInterpreter interpreter, int from) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'accept'");
interpreter.received(this, from);
}
}

View File

@ -26,7 +26,6 @@ public class PlayerReady extends ClientMessage{
@Override
public void accept(ClientInterpreter interpreter, int from) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'accept'");
interpreter.received(this, from);
}
}

View File

@ -6,8 +6,7 @@ public class RollDice extends ClientMessage{
@Override
public void accept(ClientInterpreter interpreter, int from) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'accept'");
interpreter.received(this, from);
}
}

View File

@ -26,8 +26,7 @@ public class TradeOffer extends ClientMessage{
@Override
public void accept(ClientInterpreter interpreter, int from) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'accept'");
interpreter.received(this, from);
}
}

View File

@ -27,7 +27,6 @@ public class TradeResponse extends ClientMessage{
@Override
public void accept(ClientInterpreter interpreter, int from) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'accept'");
interpreter.received(this, from);
}
}

View File

@ -6,8 +6,7 @@ public class ViewAssetsRequest extends ClientMessage{
@Override
public void accept(ClientInterpreter interpreter, int from) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'accept'");
interpreter.received(this, from);
}
}

View File

@ -16,8 +16,7 @@ public class DiceResult extends ServerMessage{
@Override
public void accept(ServerInterpreter interpreter) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'accept'");
interpreter.received(this);
}
@Override
@ -26,4 +25,8 @@ public class DiceResult extends ServerMessage{
throw new UnsupportedOperationException("Unimplemented method 'getInfoTextKey'");
}
public boolean isDoublets() {
return rollResult.get(0) == rollResult.get(1);
}
}

View File

@ -4,8 +4,7 @@ public class EventDrawCard extends ServerMessage{
@Override
public void accept(ServerInterpreter interpreter) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'accept'");
interpreter.received(this);
}
@Override

View File

@ -4,8 +4,7 @@ public class GameOver extends ServerMessage{
@Override
public void accept(ServerInterpreter interpreter) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'accept'");
interpreter.received(this);
}
@Override

View File

@ -4,8 +4,7 @@ public class GameStart extends ServerMessage{
@Override
public void accept(ServerInterpreter interpreter) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'accept'");
interpreter.received(this);
}
@Override

View File

@ -4,8 +4,7 @@ public class JailEvent extends ServerMessage{
@Override
public void accept(ServerInterpreter interpreter) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'accept'");
interpreter.received(this);
}
@Override

View File

@ -4,8 +4,7 @@ public class PlayerStatusUpdate extends ServerMessage{
@Override
public void accept(ServerInterpreter interpreter) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'accept'");
interpreter.received(this);
}
@Override

View File

@ -82,4 +82,18 @@ public interface ServerInterpreter {
* @param msg the ViewAssetsResponse message received
*/
void received(ViewAssetsResponse msg);
/**
* Handles a TradeReply message received from the server.
*
* @param msg the TradeReply message received
*/
void received(TradeReply msg);
/**
* Handles a TradeRequest message received from the server.
*
* @param msg the TradeRequest message received
*/
void received(TradeRequest msg);
}

View File

@ -4,8 +4,7 @@ public class TimeOutWarning extends ServerMessage{
@Override
public void accept(ServerInterpreter interpreter) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'accept'");
interpreter.received(this);
}
@Override

View File

@ -27,8 +27,7 @@ public class TradeReply extends ServerMessage{
@Override
public void accept(ServerInterpreter interpreter) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'accept'");
interpreter.received(this);
}
@Override

View File

@ -27,8 +27,7 @@ public class TradeRequest extends ServerMessage{
@Override
public void accept(ServerInterpreter interpreter) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'accept'");
interpreter.received(this);
}
@Override

View File

@ -4,8 +4,7 @@ public class UpdatePlayerAssets extends ServerMessage{
@Override
public void accept(ServerInterpreter interpreter) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'accept'");
interpreter.received(this);
}
@Override

View File

@ -26,8 +26,7 @@ public class ViewAssetsResponse extends ServerMessage{
@Override
public void accept(ServerInterpreter interpreter) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'accept'");
interpreter.received(this);
}
@Override