mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-02-08 02:59:36 +01:00
Legger til manglende kommentarer i Game
Legger til manglende kommentarer til initialiseringsmetodene Flytter initialiseringsmetodene nedover i filen
This commit is contained in:
parent
1ff4a1a938
commit
9a5a465f11
@ -31,34 +31,6 @@ public class Game implements IDrawableGame {
|
|||||||
initializeGame();
|
initializeGame();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeDebugMode() {
|
|
||||||
List<Robot> robots = new ArrayList<>();
|
|
||||||
try {
|
|
||||||
gameBoard = BoardLoaderUtil.loadBoard("boards/all_tiles_test_board.txt", robots);
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initializeGame() {
|
|
||||||
try {
|
|
||||||
List<Robot> robots = new ArrayList<>();
|
|
||||||
robots.add(new Robot(RobotID.ROBOT_1, new Position(1, 1)));
|
|
||||||
robots.add(new Robot(RobotID.ROBOT_2, new Position(1, 2)));
|
|
||||||
robots.add(new Robot(RobotID.ROBOT_3, new Position(1, 3)));
|
|
||||||
gameBoard = BoardLoaderUtil.loadBoard("boards/Checkmate.txt", robots);
|
|
||||||
new Thread(() -> {
|
|
||||||
try {
|
|
||||||
runGameLoop();
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
Thread.currentThread().interrupt();
|
|
||||||
}
|
|
||||||
}).start();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getWidth() {
|
public int getWidth() {
|
||||||
return gameBoard.getBoardWidth();
|
return gameBoard.getBoardWidth();
|
||||||
@ -84,6 +56,40 @@ public class Game implements IDrawableGame {
|
|||||||
return gameBoard.getAliveRobots();
|
return gameBoard.getAliveRobots();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializes the game with a debugging board
|
||||||
|
*/
|
||||||
|
private void initializeDebugMode() {
|
||||||
|
List<Robot> robots = new ArrayList<>();
|
||||||
|
try {
|
||||||
|
gameBoard = BoardLoaderUtil.loadBoard("boards/all_tiles_test_board.txt", robots);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializes the game with a playable board
|
||||||
|
*/
|
||||||
|
private void initializeGame() {
|
||||||
|
try {
|
||||||
|
List<Robot> robots = new ArrayList<>();
|
||||||
|
robots.add(new Robot(RobotID.ROBOT_1, new Position(1, 1)));
|
||||||
|
robots.add(new Robot(RobotID.ROBOT_2, new Position(1, 2)));
|
||||||
|
robots.add(new Robot(RobotID.ROBOT_3, new Position(1, 3)));
|
||||||
|
gameBoard = BoardLoaderUtil.loadBoard("boards/Checkmate.txt", robots);
|
||||||
|
new Thread(() -> {
|
||||||
|
try {
|
||||||
|
runGameLoop();
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
Thread.currentThread().interrupt();
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Does whatever the game wants to do
|
* Does whatever the game wants to do
|
||||||
* @throws InterruptedException If interrupted while trying to sleep
|
* @throws InterruptedException If interrupted while trying to sleep
|
||||||
|
Loading…
x
Reference in New Issue
Block a user