ch.sahits.game.openpatrician.model.city
Interface ICity

All Known Subinterfaces:
IBremen, ICologne, IDanzig, IHamburg, ILuebeck, IRostrock, IStettin, IVisby
All Known Implementing Classes:
Bremen, City, Cologne, Danzig, Hamburg, Luebeck, Rostock, Stettin, Visby

public interface ICity

Model of a city.

Author:
Andi Hotz, (c) Sahits GmbH, 2011 Created on Sep 16, 2011

Method Summary
 void build(IBuilding building)
          Remove a building from the list of buildings in the city
 List<IBuilding> getBuildings()
          Retrieve a list of all buildings in the city.
 int getContribution(IPlayer player, IWare ware)
          Check out what the player contributed to the ware
 IWare[] getEffectiveProduction()
          Retrieve the wares that are produced efficiently
 IWare[] getIneffectiveProduction()
          Retrieve the wares that are produced inefficiently
 EKontorType getKontorType()
          Retrieve the city type
 String getName()
          Retrieve the city name
 int getPopulation()
          retrieve the total population of the city
 int getPopulation(EPopulationClass popclass)
          Retrieve the current population of the city by class
 IReputation getReputation(IPlayer player)
          Retrieve the reputation of the player in the city
 ESocialRank getSocialRank()
          Retrieve the social rank in this city
 String getUniqueID()
          Retrieve the unique ID of the city.
 AmountablePrice getWare(IWare ware)
          Retrieve the amount of ware in the city
 int move(IWare ware, int amount, IPlayer player)
          Add or remove ware from the city.
 void moveIn(IPlayer player)
          Add a player to the city
 void setPopulation(int population, EPopulationClass popClass)
          Set the population by class
 void tearDown(IBuilding building)
          Add a new building to the city
 

Method Detail

getUniqueID

String getUniqueID()
Retrieve the unique ID of the city.

Returns:

getKontorType

EKontorType getKontorType()
Retrieve the city type

Returns:

getName

String getName()
Retrieve the city name

Returns:

getPopulation

int getPopulation(EPopulationClass popclass)
Retrieve the current population of the city by class

Parameters:
popclass -
Returns:

setPopulation

void setPopulation(int population,
                   EPopulationClass popClass)
Set the population by class

Parameters:
population -
popClass -

getPopulation

int getPopulation()
retrieve the total population of the city

Returns:

getWare

AmountablePrice getWare(IWare ware)
Retrieve the amount of ware in the city

Parameters:
ware -
Returns:

move

int move(IWare ware,
         int amount,
         IPlayer player)
Add or remove ware from the city. If the amount is negative it will be removed. If the full amount is not available only the available will be moved and returned. The amount is in the ware specific size.

Parameters:
ware - to be moved
amount - of the ware that is moved
player - that moved the ware
Returns:
amount moved

getIneffectiveProduction

IWare[] getIneffectiveProduction()
Retrieve the wares that are produced inefficiently

Returns:

getEffectiveProduction

IWare[] getEffectiveProduction()
Retrieve the wares that are produced efficiently

Returns:

getBuildings

List<IBuilding> getBuildings()
Retrieve a list of all buildings in the city. The list is immutable

Returns:

tearDown

void tearDown(IBuilding building)
Add a new building to the city

Parameters:
building -

build

void build(IBuilding building)
Remove a building from the list of buildings in the city

Parameters:
building -

getReputation

IReputation getReputation(IPlayer player)
Retrieve the reputation of the player in the city

Parameters:
player -
Returns:

getSocialRank

ESocialRank getSocialRank()
Retrieve the social rank in this city

Returns:

moveIn

void moveIn(IPlayer player)
Add a player to the city

Parameters:
player -

getContribution

int getContribution(IPlayer player,
                    IWare ware)
Check out what the player contributed to the ware

Parameters:
player - whose contribution is to be checked
ware - that is checked for contribution
Returns:
amount of the contribution may also be negative


Copyright © 2011-2012 Sahits GmbH. All Rights Reserved.