From ba83654e04f2eac41e0e2b71210503f6b02abe19 Mon Sep 17 00:00:00 2001 From: Tobydrama Date: Tue, 21 Apr 2020 14:22:08 +0200 Subject: [PATCH] =?UTF-8?q?fixed=20l=C3=A5ste=20programmeringskort?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../roborally/gamewrapper/screens/CardChoiceScreen.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/inf112/fiasko/roborally/gamewrapper/screens/CardChoiceScreen.java b/src/main/java/inf112/fiasko/roborally/gamewrapper/screens/CardChoiceScreen.java index 893f1b9..e145f72 100644 --- a/src/main/java/inf112/fiasko/roborally/gamewrapper/screens/CardChoiceScreen.java +++ b/src/main/java/inf112/fiasko/roborally/gamewrapper/screens/CardChoiceScreen.java @@ -92,7 +92,13 @@ public class CardChoiceScreen extends InputAdapter implements Screen { @Override public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) { if (chosenCards.size() == maxCards) { - roboRallyWrapper.roboRallyGame.setProgram(getCards()); + List oldProgram = roboRallyWrapper.roboRallyGame.getProgram(); + int lockedCardsInt = 5-maxCards; + List newProgram = getCards(); + for(int i = 5; i>(5-lockedCardsInt);i--){ + newProgram.add(oldProgram.get(i)); + } + roboRallyWrapper.roboRallyGame.setProgram(newProgram); roboRallyWrapper.roboRallyGame.setGameState(GameState.CHOOSING_POWER_DOWN); roboRallyWrapper.setScreen(roboRallyWrapper.screenManager.getPowerDownScreen(roboRallyWrapper)); return true;