diff --git a/src/main/java/inf112/fiasko/roborally/networking/RoboRallyClient.java b/src/main/java/inf112/fiasko/roborally/networking/RoboRallyClient.java index 52dc749..b613fbf 100644 --- a/src/main/java/inf112/fiasko/roborally/networking/RoboRallyClient.java +++ b/src/main/java/inf112/fiasko/roborally/networking/RoboRallyClient.java @@ -4,8 +4,10 @@ import com.esotericsoftware.kryonet.Client; import com.esotericsoftware.kryonet.Connection; import com.esotericsoftware.kryonet.Listener; import inf112.fiasko.roborally.game_wrapper.RoboRallyWrapper; +import inf112.fiasko.roborally.game_wrapper.screens.CardChoiceScreen; import inf112.fiasko.roborally.networking.containers.ErrorResponse; import inf112.fiasko.roborally.networking.containers.GameStartInfo; +import inf112.fiasko.roborally.objects.ProgrammingCardDeck; import inf112.fiasko.roborally.objects.RoboRallyGame; import inf112.fiasko.roborally.utility.NetworkUtil; @@ -16,7 +18,6 @@ import java.io.IOException; */ public class RoboRallyClient { private final Client client; - /** * Instantiates a new Robo Rally client * @param ipAddress The ip address of the server to connect to @@ -64,7 +65,10 @@ class RoboRallyClientListener extends Listener { } else if (object instanceof GameStartInfo) { GameStartInfo info = (GameStartInfo) object; wrapper.roboRallyGame = new RoboRallyGame(info.getPlayerList(), info.getBoardName(), - wrapper.server != null); + wrapper.server != null,info.getPlayerName()); + } + else if(object instanceof ProgrammingCardDeck){ + wrapper.setScreen(new CardChoiceScreen(wrapper,(ProgrammingCardDeck) object)); } } }