| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A class of world controllers. This is a facade.
Constructor Summary | |
WorldController(String configFile, int width, int height) Create a new worldcontroller (and a new world). |
Method Summary | |
void | clearSelection() Clear the selected humans. |
void | continueGame() Resume the game. |
void | createHuman() Toggle creating a human. |
protected String | getActionName() Return the name of the currently selected action. |
InfoList | getActionsInfo() All available actions. |
InfoList | getConstructionInfo() Get an infolist with info about the selected construction. |
protected String | getConstructionName() Return the currently selected construction name. |
protected String | getConstructionShape() Return the selected construction shape. |
List | getConstructionShapes(String constructionName) The shapes the given construction can be build in. |
InfoList | getConstructionsInfo() All available constructions. |
int | getHeight() Get the height of this world. |
InfoList | getHumanInfo() Get an infolist with info about the selected human. |
protected HumanSelection | getHumanSelection() Return the human selection of this human. |
String | getResourcePath() The resource path. |
InfoList | getResourcesInfo() Get an infolist with all the world resources. |
protected SquareOfLand | getSelectedSquare() Return the square of land that is currently selected. |
InfoList | getSquareInfo() Get an infolist with info about the selected square. |
int | getWidth() Get the width of this world. |
protected World | getWorld() return the world (= singleton !) of this worldcontroller. |
protected void | initState() Return to the initial state of this worldcontroller. |
boolean | isActiveSelected(Human human) Is the given human actively selected? |
protected boolean | isCreateHuman() Return whether we are going to create a human with the next square selection |
boolean | isRunning() Is the game running? |
boolean | isSelected(Human human) Is the given human selected? |
void | modifyVisionRange(int value) Modify the visionrange of this worldcontroller. |
void | pauseGame() Pause the game. |
void | refresh() Let all the squares fire a changed event. |
protected void | resetActionName() Set the selected action to the default action. |
void | selectActionType(String actionName) Select an action to be performed. |
void | selectConstructionShape(String shape) Specify the shape the construction should have. |
void | selectConstructionType(String constructionName) Select a construction to be constructed. |
void | selectSquareOfLand(int x, int y) Select a square of land. |
protected void | setActionName(String actionName) Set the selected action to the given action. |
protected void | setConstructionName(String constructionName) Set the selected construction name to the given construction name. |
protected void | setConstructionShape(String constructionShape) Set the selected construction shape to the given construction shape. |
protected void | setCreateHuman(boolean b) Set the boolean value that determines whether we are going to create a human with the next square selection |
protected void | setSelectedSquare(SquareOfLand square) Set the selected square of land to the given square of land. |
protected void | startAction() Start the selected action. |
void | startGame() Start the game. |
void | update(Event evt) Called when an event happens this observer is interested in. |
Constructor Detail |
public WorldController(String configFile, int width, int height)
throws java.io.FileNotFoundException,
java.io.IOException
Method Detail |
public void clearSelection()
public void continueGame()
public void createHuman()
protected String getActionName()
public InfoList getActionsInfo()
public InfoList getConstructionInfo()
protected String getConstructionName()
protected String getConstructionShape()
public List getConstructionShapes(String constructionName)
public InfoList getConstructionsInfo()
public int getHeight()
public InfoList getHumanInfo()
protected HumanSelection getHumanSelection()
public String getResourcePath()
public InfoList getResourcesInfo()
protected SquareOfLand getSelectedSquare()
public InfoList getSquareInfo()
public int getWidth()
protected World getWorld()
protected void initState()
public boolean isActiveSelected(Human human)
protected boolean isCreateHuman()
public boolean isRunning()
public boolean isSelected(Human human)
public void modifyVisionRange(int value)
public void pauseGame()
public void refresh()
protected void resetActionName()
public void selectActionType(String actionName)
public void selectConstructionShape(String shape)
public void selectConstructionType(String constructionName)
public void selectSquareOfLand(int x, int y)
throws evolution.lands.IllegalPlacementException
If there is no human on the square if we were to create a human => the human is created elseif there are humans selected => one or more humans will be popped of the selection and start performing the action. else => the square is selected else if the human is selected => let it perform the selected action else => the human is added to the selection and the square is selectedPrecondition: the x, y must denote a valid square.
protected void setActionName(String actionName)
protected void setConstructionName(String constructionName)
protected void setConstructionShape(String constructionShape)
protected void setCreateHuman(boolean b)
protected void setSelectedSquare(SquareOfLand square)
protected void startAction()
throws evolution.lands.IllegalPlacementException
public void startGame()
public void update(Event evt)
Association Links |
to Class evolution.lands.SquareOfLand
to Class java.lang.String
to Class java.lang.String
to Class java.lang.String
to Class evolution.World
| a gvijf production | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |