mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Updated App class to read team names
- updated app class so that it reads an array of maps containing team names
This commit is contained in:
@@ -1,10 +1,7 @@
|
|||||||
package seng302;
|
package seng302;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.lang.reflect.Array;
|
import java.lang.reflect.Array;
|
||||||
import java.util.Random;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class App
|
public class App
|
||||||
{
|
{
|
||||||
@@ -12,8 +9,13 @@ public class App
|
|||||||
Race race = new Race();
|
Race race = new Race();
|
||||||
|
|
||||||
// Read team names from file
|
// Read team names from file
|
||||||
FileParser fp = new FileParser("src/test/java/seng302/valid.json");
|
FileParser fp = new FileParser("doc/examples/config.json");
|
||||||
ArrayList<String> boatNames = fp.getTeams();
|
ArrayList<String> boatNames = new ArrayList<>();
|
||||||
|
ArrayList<Map<String, Object>> teams = fp.getTeams();
|
||||||
|
for (Map<String, Object> team : teams) {
|
||||||
|
boatNames.add((String) team.get("team-name"));
|
||||||
|
}
|
||||||
|
System.out.println(boatNames.toString());
|
||||||
|
|
||||||
// Shuffle team names
|
// Shuffle team names
|
||||||
long seed = System.nanoTime();
|
long seed = System.nanoTime();
|
||||||
|
|||||||
Reference in New Issue
Block a user