|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.freecol.client.control.ClientModelController
public class ClientModelController
A client-side implementation of the ModelController interface.
| Field Summary | |
|---|---|
private FreeColClient |
freeColClient
|
private static java.util.logging.Logger |
logger
|
| Constructor Summary | |
|---|---|
ClientModelController(FreeColClient freeColClient)
Creates a new ClientModelController. |
|
| Method Summary | |
|---|---|
Building |
createBuilding(java.lang.String taskID,
Colony colony,
BuildingType type)
Creates a new building. |
Unit |
createUnit(java.lang.String taskID,
Location location,
Player owner,
UnitType type)
Creates a new unit. |
void |
exploreTiles(Player player,
java.util.ArrayList<Tile> tiles)
Explores the given tiles for the given player. |
TradeRoute |
getNewTradeRoute(Player player)
Returns a new TradeRoute object. |
int |
getRandom(java.lang.String taskID,
int n)
Returns a pseudo-random int, uniformly distributed between 0 (inclusive) and the specified value (exclusive). |
void |
setStance(Player first,
Player second,
Player.Stance stance)
Updates stances. |
Location |
setToVacantEntryLocation(Unit unit)
Puts the specified Unit in America. |
void |
tileImprovementFinished(Unit unit,
TileImprovement improvement)
Tells the ModelController that a tile improvement was finished |
void |
update(Tile tile)
Tells the ModelController that an internal change (that
is; not caused by the control) has occured in the model. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.util.logging.Logger logger
private final FreeColClient freeColClient
| Constructor Detail |
|---|
public ClientModelController(FreeColClient freeColClient)
ClientModelController.
freeColClient - The main controller.| Method Detail |
|---|
public int getRandom(java.lang.String taskID,
int n)
getRandom in interface ModelControllertaskID - The taskID should be a unique identifier.
One method to make a unique taskID: n - The specified value.
public Unit createUnit(java.lang.String taskID,
Location location,
Player owner,
UnitType type)
createUnit in interface ModelControllertaskID - The taskID should be a unique identifier.
One method to make a unique taskID: location - The Location where the Unit
will be created.owner - The Player owning the Unit.type - The type of unit (Unit.FREE_COLONIST...).
Unit.
public Building createBuilding(java.lang.String taskID,
Colony colony,
BuildingType type)
createBuilding in interface ModelControllertaskID - The taskID should be a unique identifier.
One method to make a unique taskID: colony - The Colony where the Building
will be created.type - The type of building (Building.FREE_COLONIST...).
Building.public Location setToVacantEntryLocation(Unit unit)
Unit in America.
setToVacantEntryLocation in interface ModelControllerunit - The Unit.
Location where the Unit
appears.
public void setStance(Player first,
Player second,
Player.Stance stance)
setStance in interface ModelControllerfirst - The first Player.second - The second Player.stance - The new stance.
public void exploreTiles(Player player,
java.util.ArrayList<Tile> tiles)
exploreTiles in interface ModelControllerplayer - The Player that should see more tiles.tiles - The tiles to explore.public void update(Tile tile)
ModelController that an internal change (that
is; not caused by the control) has occured in the model.
tile - The Tile which will need an update.
public void tileImprovementFinished(Unit unit,
TileImprovement improvement)
ModelController that a tile improvement was finished
tileImprovementFinished in interface ModelControllerunit - an Unit valueimprovement - a TileImprovement valuepublic TradeRoute getNewTradeRoute(Player player)
TradeRoute object.
getNewTradeRoute in interface ModelControllerTradeRoute object.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||