public class Board
extends java.lang.Object
STUDENTS SHOULD NOT CHANGE THE CONTENTS OF THIS FILE IN ANY WAY.
| Modifier and Type | Field and Description |
|---|---|
private static int |
BOARD_SIZE |
private int |
goSpace |
private int |
jailSpace |
private static int |
MAX_GROUPS |
private static int |
MAX_PROPERTIES_PER_GROUP |
private Space[] |
spaces |
| Constructor and Description |
|---|
Board()
Default constructor
|
Board(java.lang.String filename)
Construct a new board from a file that specifies a layout.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getGoSpace()
Get index of the Go! space
|
int |
getJailSpace()
Get the index of the jail space
|
java.util.ArrayList<Property> |
getProperties(int group)
Get properties associated with a particular property group
|
Space |
getSpace(int index)
Get space at a particular index
|
Space[] |
getSpaces()
Get the array of spaces on the board.
|
boolean |
playerOwnsGroup(Player player,
int group)
Checks if a player owns all the properties in the group
|
private static final int BOARD_SIZE
private static final int MAX_PROPERTIES_PER_GROUP
private static final int MAX_GROUPS
private Space[] spaces
private int jailSpace
private int goSpace
public Board()
public Board(java.lang.String filename)
filename - The full path of the file to be usedpublic Space[] getSpaces()
public Space getSpace(int index)
index - Integer index of space on the board.public int getJailSpace()
public int getGoSpace()
public java.util.ArrayList<Property> getProperties(int group)
group - The property group of interestpublic boolean playerOwnsGroup(Player player, int group)
player - The playergroup - The group to check