public class Game
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.util.Random |
RNG
LEAVE THIS AS IS SO THAT RESULTS CAN BE REPEATED
After program due date, you may change to make it pseudo-random selection.
|
Constructor and Description |
---|
Game() |
Modifier and Type | Method and Description |
---|---|
static SpyGraph |
createGraphFromAreaFile(java.lang.String areaFilename)
Builds the Graph from the area data file.
|
static void |
help()
Prints the possible commands a player can enter
|
void |
init(java.lang.String configFilename,
java.lang.String areaFilename) |
static void |
main(java.lang.String[] args) |
static void |
map(SpyGraph g,
java.lang.String start,
java.lang.String end)
Display different paths from the start node to the selected "end" node.
|
static boolean |
move(Player play,
java.lang.String end) |
public static final java.util.Random RNG
public void init(java.lang.String configFilename, java.lang.String areaFilename) throws InvalidAreaFileException
InvalidAreaFileException
public static void main(java.lang.String[] args) throws java.io.FileNotFoundException, InvalidAreaFileException
args
- - args[0] is a file containing various arguments, args[1] contains the graphjava.io.FileNotFoundException
- if the input files do not existInvalidAreaFileException
- if the input provided for the graph does not specify a graphpublic static boolean move(Player play, java.lang.String end)
play
- - playerend
- - node to move topublic static void map(SpyGraph g, java.lang.String start, java.lang.String end)
g
- The graph to search for a pathstart
- The name of the first node in the pathend
- The name of the last node in the pathpublic static void help()
public static SpyGraph createGraphFromAreaFile(java.lang.String areaFilename) throws InvalidAreaFileException
areaFilename
- The name of a file that contains information
for creating an undirected graph. Vertex names and edge pairs.InvalidAreaFileException
- if the file does not correspond to a graph