mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-01-31 15:19:35 +01:00
fixed some bugs with locked cards
This commit is contained in:
parent
05a92ff9a0
commit
d36ff8192b
@ -95,9 +95,12 @@ public class CardChoiceScreen extends InputAdapter implements Screen {
|
||||
List<ProgrammingCard> oldProgram = roboRallyWrapper.roboRallyGame.getProgram();
|
||||
int lockedCardsInt = 5-maxCards;
|
||||
List<ProgrammingCard> newProgram = getCards();
|
||||
for(int i = 5; i>(5-lockedCardsInt);i--){
|
||||
for(int i = 4; i>(4-lockedCardsInt);i--){
|
||||
newProgram.add(oldProgram.get(i));
|
||||
}
|
||||
System.out.println("fuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuasdasdasda234234234: "+newProgram.size());
|
||||
System.out.println(newProgram);
|
||||
|
||||
roboRallyWrapper.roboRallyGame.setProgram(newProgram);
|
||||
roboRallyWrapper.roboRallyGame.setGameState(GameState.CHOOSING_POWER_DOWN);
|
||||
roboRallyWrapper.setScreen(roboRallyWrapper.screenManager.getPowerDownScreen(roboRallyWrapper));
|
||||
|
@ -46,6 +46,7 @@ public class LoadingScreen extends AbstractScreen {
|
||||
|
||||
if (roboRallyWrapper.roboRallyGame != null) {
|
||||
GameState gameState = roboRallyWrapper.roboRallyGame.getGameState();
|
||||
System.out.println(gameState);
|
||||
if (gameState != GameState.LOADING) {
|
||||
handleScreenChange(gameState);
|
||||
}
|
||||
|
@ -110,7 +110,9 @@ class RoboRallyServerListener extends Listener {
|
||||
*/
|
||||
private void receiveContinuePowerDown(Connection connection, Boolean bool) {
|
||||
stayInPowerDown.put(connection, bool);
|
||||
System.out.println("fuuuuuuuuuuuuuuuuu");
|
||||
if (receivedDataFromAllConnections(stayInPowerDown)) {
|
||||
System.out.println("fuuuuuuuuuuuuuuuuasdasdasdasdasdasdasdu");
|
||||
Map<String, Boolean> powerDowns = new HashMap<>();
|
||||
for (Connection connected : stayInPowerDown.keySet()) {
|
||||
powerDowns.put(playerNames.get(connected), stayInPowerDown.get(connected));
|
||||
@ -149,8 +151,11 @@ class RoboRallyServerListener extends Listener {
|
||||
*/
|
||||
private <K> boolean receivedDataFromAllConnections(Map<Connection, K> data) {
|
||||
Set<Connection> connections = clients.keySet();
|
||||
System.out.println("keys "+data.keySet());
|
||||
System.out.println(connections);
|
||||
connections.removeAll(deadPlayers);
|
||||
return connections.containsAll(data.keySet()) && data.keySet().containsAll(connections);
|
||||
System.out.println(connections);
|
||||
return data.keySet().containsAll(connections);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user