fixed låste programmeringskort

This commit is contained in:
Tobydrama 2020-04-21 14:22:08 +02:00
parent ee18396d3e
commit ba83654e04

View File

@ -92,7 +92,13 @@ public class CardChoiceScreen extends InputAdapter implements Screen {
@Override @Override
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) { public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
if (chosenCards.size() == maxCards) { if (chosenCards.size() == maxCards) {
roboRallyWrapper.roboRallyGame.setProgram(getCards()); List<ProgrammingCard> oldProgram = roboRallyWrapper.roboRallyGame.getProgram();
int lockedCardsInt = 5-maxCards;
List<ProgrammingCard> 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.roboRallyGame.setGameState(GameState.CHOOSING_POWER_DOWN);
roboRallyWrapper.setScreen(roboRallyWrapper.screenManager.getPowerDownScreen(roboRallyWrapper)); roboRallyWrapper.setScreen(roboRallyWrapper.screenManager.getPowerDownScreen(roboRallyWrapper));
return true; return true;