|
|||||||||
| 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 ch.sahits.game.openpatrician.model.ship.IShip |
activeShip
Reference the active ship of the player |
private ch.sahits.game.openpatrician.model.city.ICity |
city
|
private ch.sahits.game.openpatrician.model.IPlayer |
player
|
private List<ch.sahits.game.openpatrician.model.ship.IShip> |
playerShips
List holding all ships owned by the player currently present in the city |
private List<ch.sahits.game.openpatrician.model.ship.IShip> |
shipList
List holding all ships currently present in the city |
| Constructor Summary | |
|---|---|
CityPlayerProxy(ch.sahits.game.openpatrician.model.city.ICity city,
ch.sahits.game.openpatrician.model.IPlayer player)
Constructor initializing the city and the player |
|
CityPlayerProxy(ch.sahits.game.openpatrician.model.city.ICity city,
ch.sahits.game.openpatrician.model.IPlayer player,
ch.sahits.game.openpatrician.model.ship.IShip activeShip)
Constructor initializing the city and the player with one ship in port. |
|
| Method Summary | |
|---|---|
void |
activateShip(ch.sahits.game.openpatrician.model.ship.IShip ship)
Activate a ship. |
void |
arrive(ch.sahits.game.openpatrician.model.ship.IShip ship)
A ship arrives in the city |
void |
gameUpdate(ch.sahits.game.event.Event e,
Object eventNotice)
Handle all the events that are generated from outside (not by the player). |
ch.sahits.game.openpatrician.model.ship.IShip |
getActiveShip()
Retrieve the players active ship |
ch.sahits.game.openpatrician.model.city.ICity |
getCity()
|
ch.sahits.game.openpatrician.model.IPlayer |
getPlayer()
|
List<ch.sahits.game.openpatrician.model.ship.IShip> |
getPlayersShips()
Retrieve the list of all ships of the player currently in the port. |
void |
leave(ch.sahits.game.openpatrician.model.ship.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 ch.sahits.game.openpatrician.model.city.ICity city
private final ch.sahits.game.openpatrician.model.IPlayer player
private List<ch.sahits.game.openpatrician.model.ship.IShip> shipList
private List<ch.sahits.game.openpatrician.model.ship.IShip> playerShips
private ch.sahits.game.openpatrician.model.ship.IShip activeShip
| Constructor Detail |
|---|
public CityPlayerProxy(ch.sahits.game.openpatrician.model.city.ICity city,
ch.sahits.game.openpatrician.model.IPlayer player)
city - player -
public CityPlayerProxy(ch.sahits.game.openpatrician.model.city.ICity city,
ch.sahits.game.openpatrician.model.IPlayer player,
ch.sahits.game.openpatrician.model.ship.IShip activeShip)
city - player - activeShip - | Method Detail |
|---|
public ch.sahits.game.openpatrician.model.ship.IShip getActiveShip()
public void activateShip(ch.sahits.game.openpatrician.model.ship.IShip ship)
IllegalArgumentException will be thrown
ship -
IllegalArgumentException - if the ship cannot be activated due to its non existencepublic List<ch.sahits.game.openpatrician.model.ship.IShip> getPlayersShips()
public void gameUpdate(ch.sahits.game.event.Event e,
Object eventNotice)
gameUpdate in interface ch.sahits.game.event.IEventListenerpublic void arrive(ch.sahits.game.openpatrician.model.ship.IShip ship)
ship - public void leave(ch.sahits.game.openpatrician.model.ship.IShip ship)
ship - public ch.sahits.game.openpatrician.model.city.ICity getCity()
public ch.sahits.game.openpatrician.model.IPlayer getPlayer()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||