evolution
Class World


public class World

Represents the game world. This is the main class.

Stereotype singleton

Constructor Summary
World(WorldController c, String fileName, int width, int height)
          Create a new world.

Method Summary
 voidcreateHuman(SquareOfLand sq)
          Create a human on a sqyare of land.
 GameBoardgetGameBoard()
          Return the game board.
 intgetHeight()
          The height of the game board.
 static WorldgetInst()
          Return the instance of this world.
 ResourcegetResource(String r)
          Returns the given world resource.
 MapgetResources()
          Returns a list of world resources.
 InfoListgetResourcesInfo()
          Information about the world resources.
 intgetWidth()
          The width of the game board.
 protected WorldControllergetWorldController()
          Return the worldcontroller.
 booleanisActiveSelected(Human human)
          Check whether the given human is the last selected human or not.
 booleanisSelected(Human human)
          Check whether the given human is selected or not.
 voidrefresh()
           
 protected voidsetWorldController(WorldController c)
          Set the worldcontroller.

Constructor Detail

World

public World(WorldController c, String fileName, int width, int height)
throws java.io.FileNotFoundException,
java.io.IOException
Create a new world. The world will be created in the pause mode, so one needs to call world.startGame() to start playing.
Parameters:
width - The width of the game board
height - The height of the game board
fileName - The main configuration file on which this world should be based. From this configuration file the path is stripped and used as the resource path to load other config files and images.
Method Detail

createHuman

public void createHuman(SquareOfLand sq)
throws CreationPowerInsufficientException,
evolution.lands.IllegalPlacementException
Create a human on a sqyare of land.

getGameBoard

public GameBoard getGameBoard()
Return the game board.

getHeight

public int getHeight()
The height of the game board.

getInst

public static World getInst()
Return the instance of this world.

getResource

public Resource getResource(String r)
throws evolution.resources.NoSuchResourceException
Returns the given world resource.

getResources

public Map getResources()
Returns a list of world resources.

getResourcesInfo

public InfoList getResourcesInfo()
Information about the world resources.

getWidth

public int getWidth()
The width of the game board.

getWorldController

protected WorldController getWorldController()
Return the worldcontroller.

isActiveSelected

public boolean isActiveSelected(Human human)
Check whether the given human is the last selected human or not.

isSelected

public boolean isSelected(Human human)
Check whether the given human is selected or not.

refresh

public void refresh()

setWorldController

protected void setWorldController(WorldController c)
Set the worldcontroller.

Association Links

to Class evolution.GameBoard

The GameBoard attached to this World.

to Class java.util.Map

The world resources.

to Class evolution.World

The instance of this world.

to Class evolution.CreationPower

The creation power of this world.

to Class evolution.WorldController

The worldcontroller of this world.

a gvijf production