evolution
Class GameBoard


public class GameBoard

The GameBoard keeps tracks of all the SquareOfLand objects.


Constructor Summary
 protected GameBoard(int width, int height)
          Create a new *empty* gameboard with the given size.

Method Summary
 static GameBoardcreate(int width, int height)
          Create a new random gameboard.
 ListgetConstructionList()
          Get the constructionlist of the gameboard.
 intgetHeight()
          Get the height of the gameboard.
 SquareOfLandgetSquare(int x, int y)
          Get the square at the given position.
 ListgetSurroundingSquares(SquareOfLand sq, int range, boolean explored)
          Get the surrounding squares in the range of a certain position.
 intgetWidth()
          Get the width of the gameboard.
 voidplace(int x, int y, Human human)
          Place a human on the given spot.

Constructor Detail

GameBoard

protected GameBoard(int width, int height)
Create a new *empty* gameboard with the given size.
Method Detail

create

public static GameBoard create(int width, int height)
Create a new random gameboard.

getConstructionList

public List getConstructionList()
Get the constructionlist of the gameboard.

getHeight

public int getHeight()
Get the height of the gameboard.

getSquare

public SquareOfLand getSquare(int x, int y)
Get the square at the given position.

getSurroundingSquares

public List getSurroundingSquares(SquareOfLand sq, int range, boolean explored)
Get the surrounding squares in the range of a certain position.
Parameters:
explored: - only add explored squares if this is true.

getWidth

public int getWidth()
Get the width of the gameboard.

place

public void place(int x, int y, Human human)
throws evolution.lands.IllegalPlacementException
Place a human on the given spot.
Throws:
IllegalPlacementException - If the human is not allowed to stand on this piece of land.

Association Links

to Class evolution.lands.SquareOfLand

Type aggregation
associates <{evolution.lands.SquareOfLand}>

to Class java.util.List

A list of all the completed constructions the squaresOfLand of this Gameboard contain.

a gvijf production