changes in mainMethod
This commit is contained in:
		
							parent
							
								
									0c63540616
								
							
						
					
					
						commit
						1362850570
					
				| 
						 | 
				
			
			@ -5,6 +5,7 @@ import org.beryx.textio.TextIoFactory;
 | 
			
		|||
import org.beryx.textio.TextTerminal;
 | 
			
		||||
 | 
			
		||||
import java.util.HashMap;
 | 
			
		||||
import java.util.Random;
 | 
			
		||||
 | 
			
		||||
import static ch.zhaw.catan.Command.*;
 | 
			
		||||
import static ch.zhaw.catan.Command.QUIT;
 | 
			
		||||
| 
						 | 
				
			
			@ -17,13 +18,22 @@ public class Siedler {
 | 
			
		|||
        Parser parser = new Parser();
 | 
			
		||||
        SiedlerGame game = foundingPhase(parser);
 | 
			
		||||
        boolean running = true;
 | 
			
		||||
        boolean diceThrown = false;
 | 
			
		||||
        while (running){
 | 
			
		||||
            parser.displayGameboard(game.getBoard().getTextView());
 | 
			
		||||
            parser.playerTurn(game.getCurrentPlayerFaction());
 | 
			
		||||
            if(!diceThrown) {
 | 
			
		||||
                Random random = new Random();
 | 
			
		||||
                int thrownDices = random.nextInt(6) + random.nextInt(6);
 | 
			
		||||
                parser.thrownDices(thrownDices);
 | 
			
		||||
                //todo resourcen auszahlen
 | 
			
		||||
                diceThrown = true;
 | 
			
		||||
            }
 | 
			
		||||
            parser.displayPlayerResourceStock(game.getCurruntPlayerResource());
 | 
			
		||||
            switch (parser.getAction()) {
 | 
			
		||||
                case NEXTPLAYER:
 | 
			
		||||
                    game.switchToNextPlayer();
 | 
			
		||||
                    diceThrown = false;
 | 
			
		||||
                    break;
 | 
			
		||||
                case BUILDSETTLEMENT:
 | 
			
		||||
                    parser.giveCoordinatesForStructures(Config.Structure.SETTLEMENT);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue