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 @Override
public void accept(ClientInterpreter interpreter, int from) { public void accept(ClientInterpreter interpreter, int from) {
// TODO Auto-generated method stub interpreter.received(this, from);
throw new UnsupportedOperationException("Unimplemented method 'accept'");
} }
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -16,8 +16,7 @@ public class DiceResult extends ServerMessage{
@Override @Override
public void accept(ServerInterpreter interpreter) { public void accept(ServerInterpreter interpreter) {
// TODO Auto-generated method stub interpreter.received(this);
throw new UnsupportedOperationException("Unimplemented method 'accept'");
} }
@Override @Override
@ -26,4 +25,8 @@ public class DiceResult extends ServerMessage{
throw new UnsupportedOperationException("Unimplemented method 'getInfoTextKey'"); 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 @Override
public void accept(ServerInterpreter interpreter) { public void accept(ServerInterpreter interpreter) {
// TODO Auto-generated method stub interpreter.received(this);
throw new UnsupportedOperationException("Unimplemented method 'accept'");
} }
@Override @Override

View File

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

View File

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

View File

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

View File

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

View File

@ -82,4 +82,18 @@ public interface ServerInterpreter {
* @param msg the ViewAssetsResponse message received * @param msg the ViewAssetsResponse message received
*/ */
void received(ViewAssetsResponse msg); 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 @Override
public void accept(ServerInterpreter interpreter) { public void accept(ServerInterpreter interpreter) {
// TODO Auto-generated method stub interpreter.received(this);
throw new UnsupportedOperationException("Unimplemented method 'accept'");
} }
@Override @Override

View File

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

View File

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

View File

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

View File

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