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