ch.sahits.game.openpatrician.model.city
Class BuildingProduction

java.lang.Object
  extended by ch.sahits.game.openpatrician.model.city.BuildingProduction

public class BuildingProduction
extends Object

This class helps computing the production amount for the different buildings

Author:
Andi Hotz, (c) Sahits GmbH, 2012 Created on Jul 18, 2012

Constructor Summary
BuildingProduction()
           
 
Method Summary
 int getConsumption(IWare ware, ICity city, IPlayer player)
          Retrieve the amount of ware that all the workshops of a player consume within a week
 int getProduction(IWare ware, ICity city, IPlayer player)
          Compute the total amount of ware the player produces in the city within a week
 int getTotalConsumtion(IWare ware, ICity city)
          Retrieve the amount the workshops consume to produce the ware within a week
 int getTotalProduction(IWare ware, ICity city)
          Compute the total amount of ware that is produced in the city within a week
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuildingProduction

public BuildingProduction()
Method Detail

getTotalProduction

public int getTotalProduction(IWare ware,
                              ICity city)
Compute the total amount of ware that is produced in the city within a week

Parameters:
ware - that is produced
city - in witch the ware is produced
Returns:
total amount of all the production by all the players in the city

getProduction

public int getProduction(IWare ware,
                         ICity city,
                         IPlayer player)
Compute the total amount of ware the player produces in the city within a week

Parameters:
ware - that is produced
city - in witch the ware is produced
player - that produces the ware
Returns:
total amount of the ware produced by that player in the city

getTotalConsumtion

public int getTotalConsumtion(IWare ware,
                              ICity city)
Retrieve the amount the workshops consume to produce the ware within a week

Parameters:
ware - that is consumed
city - in witch the ware is consumed
Returns:
amount of the ware that is consumed

getConsumption

public int getConsumption(IWare ware,
                          ICity city,
                          IPlayer player)
Retrieve the amount of ware that all the workshops of a player consume within a week

Parameters:
ware - that is consumed
city - in witch the ware is consumed
player - who owns the workshops
Returns:
amount of the ware that is consumed


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