|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectch.sahits.game.graphic.display.model.CityPlayerProxy
public class CityPlayerProxy
The CityView is a view model of a city. It provides access to the city model as well as player specific aspects of the city, for example buildings, ships and so forth.
| Field Summary | |
|---|---|
private IShip |
activeShip
Reference the active ship of the player |
private ICity |
city
|
private IPlayer |
player
|
private List<IShip> |
playerShips
List holding all ships owned by the player currently present in the city |
private List<IShip> |
shipList
List holding all ships currently present in the city |
| Constructor Summary | |
|---|---|
CityPlayerProxy(ICity city,
IPlayer player)
Constructor initializing the city and the player |
|
CityPlayerProxy(ICity city,
IPlayer player,
IShip activeShip)
Constructor initializing the city and the player with one ship in port. |
|
| Method Summary | |
|---|---|
void |
activateShip(IShip ship)
Activate a ship. |
void |
arrive(IShip ship)
A ship arrives in the city |
void |
gameUpdate(Event e,
Object eventNotice)
Handle all the events that are generated from outside (not by the player). |
IShip |
getActiveShip()
Retrieve the players active ship |
ICity |
getCity()
Retrieve the city reference |
IPlayer |
getPlayer()
retrieve the player reference |
List<IShip> |
getPlayersShips()
Retrieve the list of all ships of the player currently in the port. |
void |
leave(IShip ship)
Ship leave the city |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final ICity city
private final IPlayer player
private List<IShip> shipList
private List<IShip> playerShips
private IShip activeShip
| Constructor Detail |
|---|
public CityPlayerProxy(ICity city,
IPlayer player)
city - player -
public CityPlayerProxy(ICity city,
IPlayer player,
IShip activeShip)
city - player - activeShip - | Method Detail |
|---|
public IShip getActiveShip()
ICityPlayerProxy
getActiveShip in interface ICityPlayerProxypublic void activateShip(IShip ship)
IllegalArgumentException will be thrown
ship -
IllegalArgumentException - if the ship cannot be activated due to its non existencepublic List<IShip> getPlayersShips()
ICityPlayerProxy
getPlayersShips in interface ICityPlayerProxy
public void gameUpdate(Event e,
Object eventNotice)
gameUpdate in interface IEventListenerpublic void arrive(IShip ship)
ship - public void leave(IShip ship)
ship - public ICity getCity()
ICityPlayerProxy
getCity in interface ICityPlayerProxypublic IPlayer getPlayer()
ICityPlayerProxy
getPlayer in interface ICityPlayerProxy
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||