-
Notifications
You must be signed in to change notification settings - Fork 510
Expand file tree
/
Copy pathMain.java
More file actions
30 lines (25 loc) · 1.44 KB
/
Main.java
File metadata and controls
30 lines (25 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package org.main;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws FileNotFoundException, InterruptedException {
System.out.println("Hello and welcome to the Snake and Ladder!");
Scanner scanner = new Scanner(System.in);
String filepath="";
GameFilePathManager gameFilePathManager = new GameFilePathManager();
while (!(gameFilePathManager.validateAndSetFilePath(filepath))) {
System.out.println("Please give the valid game Loader file path");
filepath = scanner.nextLine();
}
GameBoard gameBoard = new SnakeAndLadderGameBoard(gameFilePathManager, new Dice(2), 120);
SnakeAndLadderGameBoardLoader snakeAndLadderGameBoardLoader = new SnakeAndLadderGameBoardLoader(gameBoard);
snakeAndLadderGameBoardLoader.LoadGameboard();
for(int i =0; i<1; i++) {
SnakeAndLadderGamePlayers snakeAndLadderGamePlayers = new SnakeAndLadderGamePlayers();
snakeAndLadderGamePlayers.LoadPlayers(snakeAndLadderGameBoardLoader.getSnakeAndLadderGamePlayersNames());
SnakeAndLadderGameBoardPlay snakeAndLadderGameBoardPlay = new SnakeAndLadderGameBoardPlay((SnakeAndLadderGameBoard)gameBoard, snakeAndLadderGamePlayers);
snakeAndLadderGameBoardPlay.StartGame();
System.out.println("Thanks for playing the snake and ladder Game!!!!");
}
}
}