mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-01-31 23:29:36 +01:00
added some new cases new cases for the listner
This commit is contained in:
parent
8f73c043bd
commit
0c3a8739e1
@ -2,13 +2,18 @@ package inf112.fiasko.roborally.networking;
|
||||
|
||||
import com.esotericsoftware.kryonet.Connection;
|
||||
import com.esotericsoftware.kryonet.Listener;
|
||||
import inf112.fiasko.roborally.elementproperties.GameState;
|
||||
import inf112.fiasko.roborally.gamewrapper.RoboRallyWrapper;
|
||||
import inf112.fiasko.roborally.gamewrapper.screens.CardChoiceScreen;
|
||||
import inf112.fiasko.roborally.networking.containers.ErrorResponse;
|
||||
import inf112.fiasko.roborally.networking.containers.GameStartInfo;
|
||||
import inf112.fiasko.roborally.networking.containers.PowerdownContainer;
|
||||
import inf112.fiasko.roborally.networking.containers.ProgamsContainer;
|
||||
import inf112.fiasko.roborally.objects.ProgrammingCardDeck;
|
||||
import inf112.fiasko.roborally.objects.RoboRallyGame;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* This listener handles all receiving from the server
|
||||
*/
|
||||
@ -33,11 +38,22 @@ class RoboRallyClientListener extends Listener {
|
||||
GameStartInfo info = (GameStartInfo) object;
|
||||
wrapper.roboRallyGame = new RoboRallyGame(info.getPlayerList(), info.getBoardName(),
|
||||
wrapper.server != null, info.getPlayerName(), wrapper.client, wrapper.server);
|
||||
wrapper.setScreen(wrapper.screenManager.getLoadingScreen(wrapper));
|
||||
}
|
||||
else if(object instanceof ProgrammingCardDeck){
|
||||
wrapper.setScreen(new CardChoiceScreen(wrapper,(ProgrammingCardDeck) object));
|
||||
wrapper.roboRallyGame.setGameState(GameState.CHOOSING_CARDS);
|
||||
wrapper.roboRallyGame.setPlayerHand((ProgrammingCardDeck) object);
|
||||
}
|
||||
else if(object instanceof ProgamsContainer){
|
||||
try {
|
||||
wrapper.roboRallyGame.reciveAllProgrammes((ProgamsContainer) object);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
else if (object instanceof PowerdownContainer){
|
||||
wrapper.roboRallyGame.recivedStayInPowerdown((PowerdownContainer) object);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user