src/Operator.java
/*
	 * Initializes all players by reading the input file passed through the
	 * constructor, then it starts all the players (which means putting them to
	 * sleep for their corresponding timings)
	 */
Initializes all players by reading the input file passed through the
constructor, then it starts all the players (which means putting them to
sleep for their corresponding timings)
Initializes all players by reading the input file passed through the constructor then it starts all the players ( which means putting them to sleep for their corresponding timings )
public void initializePlayers(String filePath) {
		try {
			File file = new File(filePath);
			Scanner sc = new Scanner(file);
			this.wheel.maxWaitTime = Integer.parseInt(sc.nextLine());
			this.totalPlayerCount = Integer.parseInt(sc.nextLine());
			LinkedList<Player> temp = new LinkedList<Player>();
			while (sc.hasNextLine()) {
				String line = sc.nextLine();
				if (line.length() != 0) {
					String[] values = line.split(",");
					Player player = new Player(values[0], values[1], this);
					temp.add(player);
				}
			}
			for (Player player : temp) {
				player.start();
			}
		} catch (FileNotFoundException e) {
			e.printStackTrace();
			System.exit(0);
		}
	}
public void initializePlayers ( String filePath ) { try { File file = new File ( filePath ) ; Scanner sc = new Scanner ( file ) ; this . wheel . maxWaitTime = Integer . parseInt ( sc . nextLine ( ) ) ; this . totalPlayerCount = Integer . parseInt ( sc . nextLine ( ) ) ; LinkedList < Player > temp = new LinkedList < Player > ( ) ; while ( sc . hasNextLine ( ) ) { String line = sc . nextLine ( ) ; if ( line . length ( ) != 0 ) { String [ ] values = line . split ( "," ) ; Player player = new Player ( values [ 0 ] , values [ 1 ] , this ) ; temp . add ( player ) ; } } for ( Player player : temp ) { player . start ( ) ; } } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; System . exit ( 0 ) ; } }
Initializes all players by reading the input file passed through the
 constructor, then it starts all the players (which means putting them to
 sleep for their corresponding timings)
Initializes all players by reading the input file passed through the constructor then it starts all the players ( which means putting them to sleep for their corresponding timings )
// player.start(); // The temporary array to ensure a faster consecutive starting of // the players since starting them while reading is more expensive