ch.sahits.game.openpatrician.model.people
Class ReputationCalculator

java.lang.Object
  extended by ch.sahits.game.openpatrician.model.people.ReputationCalculator

public class ReputationCalculator
extends Object

Calculator for a players reputation

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

Field Summary
private  PopulationConsume consumer
           
private  CityProduction producer
           
 
Constructor Summary
ReputationCalculator()
           
 
Method Summary
 int calculateWareRepputation(ICity city, IPlayer player)
          Check each ware if the player contributes and what amount.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

consumer

private final PopulationConsume consumer

producer

private final CityProduction producer
Constructor Detail

ReputationCalculator

public ReputationCalculator()
Method Detail

calculateWareRepputation

public int calculateWareRepputation(ICity city,
                                    IPlayer player)
Check each ware if the player contributes and what amount. If the city contributes enough to cover the needs, this ware is irrelevant for the computation If the player contributes enough to cover all the need he gets 100 points for the ware. If he contributes less he gets a fraction according to what he contributes.

Parameters:
city - for which the ware based reputation should be checked
player - for whom the reputation is calculated
Returns:
value between 0 and 100


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