Merge remote-tracking branch 'origin/main'
This commit is contained in:
		
						commit
						3e50a96f41
					
				| 
						 | 
					@ -255,7 +255,12 @@ class GameTest {
 | 
				
			||||||
        private final Integer[] instructions;
 | 
					        private final Integer[] instructions;
 | 
				
			||||||
        private int pointerDir,pointerInstruction;
 | 
					        private int pointerDir,pointerInstruction;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /**
 | 
				
			||||||
 | 
					         * Constructor to create a new Interface Object
 | 
				
			||||||
 | 
					         * @param welcometext The first Text which will be printed in the UserInterface Window
 | 
				
			||||||
 | 
					         * @param instructions list of instructions to simulate userinput
 | 
				
			||||||
 | 
					         * @param directions list of Directions to simulate userinput
 | 
				
			||||||
 | 
					         */
 | 
				
			||||||
        public Interface(String welcometext, Integer[] instructions, PositionVector.Direction[] directions) {
 | 
					        public Interface(String welcometext, Integer[] instructions, PositionVector.Direction[] directions) {
 | 
				
			||||||
            super(welcometext);
 | 
					            super(welcometext);
 | 
				
			||||||
            pointerDir = -1;
 | 
					            pointerDir = -1;
 | 
				
			||||||
| 
						 | 
					@ -264,6 +269,12 @@ class GameTest {
 | 
				
			||||||
            this.directions = directions;
 | 
					            this.directions = directions;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /**
 | 
				
			||||||
 | 
					         * Overwriting Method for testing without userinteraction
 | 
				
			||||||
 | 
					         * @param text    Text which is printed before the options are printed. Example: "Select Track file:"
 | 
				
			||||||
 | 
					         * @param options List with the options which can be selected.
 | 
				
			||||||
 | 
					         * @return the selected Option
 | 
				
			||||||
 | 
					         */
 | 
				
			||||||
        @Override
 | 
					        @Override
 | 
				
			||||||
        public int selectOption(String text, List<String> options) {
 | 
					        public int selectOption(String text, List<String> options) {
 | 
				
			||||||
            pointerInstruction++;
 | 
					            pointerInstruction++;
 | 
				
			||||||
| 
						 | 
					@ -271,12 +282,29 @@ class GameTest {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /**
 | 
				
			||||||
 | 
					         * Overwriting Method for testing without userinteraction
 | 
				
			||||||
 | 
					         * @param text The Text which should be printed.
 | 
				
			||||||
 | 
					         */
 | 
				
			||||||
 | 
					        @Override
 | 
				
			||||||
        public void printInformation(String text) {
 | 
					        public void printInformation(String text) {
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /**
 | 
				
			||||||
 | 
					         * Overwriting Method for testing without userinteraction
 | 
				
			||||||
 | 
					         * @param text Output Text
 | 
				
			||||||
 | 
					         */
 | 
				
			||||||
 | 
					        @Override
 | 
				
			||||||
        public void quit(String text) {
 | 
					        public void quit(String text) {
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /**
 | 
				
			||||||
 | 
					         * Overwriting Method for testing without userinteraction
 | 
				
			||||||
 | 
					         * @param playingCarIndex the index of the player
 | 
				
			||||||
 | 
					         * @param playingCarID    the ID of the player
 | 
				
			||||||
 | 
					         * @return the direction to accelerate
 | 
				
			||||||
 | 
					         */
 | 
				
			||||||
 | 
					        @Override
 | 
				
			||||||
        public PositionVector.Direction selectDirection(int playingCarIndex, char playingCarID) {
 | 
					        public PositionVector.Direction selectDirection(int playingCarIndex, char playingCarID) {
 | 
				
			||||||
            pointerDir += 1;
 | 
					            pointerDir += 1;
 | 
				
			||||||
            if(pointerDir < directions.length) {
 | 
					            if(pointerDir < directions.length) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue