Class GamePiece
java.lang.Object
GamePiece
The GamePiece tile object for the Tetravex game. Stores four values:
north, south, east, and west representing the top, bottom,
right, and left edge of the tile.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intData fields for the north, south, east, west values respectively.private intA unique identifier for the GamePieceprivate intData fields for the north, south, east, west values respectively.static intThe number of GamePiece objects created.private intData fields for the north, south, east, west values respectively.static final intNumber of possible values at each position.private intData fields for the north, south, east, west values respectively. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetEast()Gets the east value of the GamePiece.intgetId()Get the id number of the GamePieceintgetNorth()Gets the north value of the GamePiece.intgetSouth()Gets the south value of the GamePiece.intgetWest()Gets the west value of the GamePiece.voidsetEast(int east) Sets the east value of the GamePiece.voidsetNorth(int north) Sets the north value of the GamePiece.voidsetSouth(int south) Sets the south value of the GamePiece.voidsetWest(int west) Sets the west value of the GamePiece.
-
Field Details
-
VALUES
public static final int VALUESNumber of possible values at each position.- See Also:
-
NUM_PIECES
public static int NUM_PIECESThe number of GamePiece objects created. Used to generate id numbers. -
north
private int northData fields for the north, south, east, west values respectively. -
south
private int southData fields for the north, south, east, west values respectively. -
east
private int eastData fields for the north, south, east, west values respectively. -
west
private int westData fields for the north, south, east, west values respectively. -
id
private int idA unique identifier for the GamePiece
-
-
Constructor Details
-
GamePiece
public GamePiece()Construct a GamePiece object with random values.
-
-
Method Details
-
getNorth
public int getNorth()Gets the north value of the GamePiece.- Returns:
- the north value.
-
setNorth
public void setNorth(int north) Sets the north value of the GamePiece.- Parameters:
north- the new value.
-
getSouth
public int getSouth()Gets the south value of the GamePiece.- Returns:
- the south value.
-
setSouth
public void setSouth(int south) Sets the south value of the GamePiece.- Parameters:
south- the new value.
-
getEast
public int getEast()Gets the east value of the GamePiece.- Returns:
- the east value.
-
setEast
public void setEast(int east) Sets the east value of the GamePiece.- Parameters:
east- the new value.
-
getWest
public int getWest()Gets the west value of the GamePiece.- Returns:
- the west value.
-
setWest
public void setWest(int west) Sets the west value of the GamePiece.- Parameters:
west- the new value.
-
getId
public int getId()Get the id number of the GamePiece- Returns:
- the unique id number
-