ch.sahits.game.openpatrician.model.personal.impl
Class Reputation

java.lang.Object
  extended by ch.sahits.game.openpatrician.model.personal.impl.Reputation
All Implemented Interfaces:
IReputation, IPeriodicalUpdate

public class Reputation
extends Object
implements IReputation, IPeriodicalUpdate

Implementation of the reputation.

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

Field Summary
private  ICity city
           
private  IPlayer player
           
private  ReputationCalculator repCalc
           
private  int reputationCurrentWeek
           
private  int reputationLastWeek
           
 
Constructor Summary
Reputation(ICity city, IPlayer player)
           
 
Method Summary
 int getPopularity()
          Retrieve the popularity of the player in the city
 int getReputationDifference()
          Retrieve the change in reputation within the last week.
 void notify(DateObject date)
          The time defined as period has passed and it is now date
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

reputationLastWeek

private int reputationLastWeek

reputationCurrentWeek

private int reputationCurrentWeek

city

private final ICity city

player

private final IPlayer player

repCalc

private final ReputationCalculator repCalc
Constructor Detail

Reputation

public Reputation(ICity city,
                  IPlayer player)
Method Detail

getReputationDifference

public int getReputationDifference()
Description copied from interface: IReputation
Retrieve the change in reputation within the last week. Single digit values indicate a small change, values larger than 25 indicate a very large change.

Specified by:
getReputationDifference in interface IReputation
Returns:

notify

public void notify(DateObject date)
Description copied from interface: IPeriodicalUpdate
The time defined as period has passed and it is now date

Specified by:
notify in interface IPeriodicalUpdate
Parameters:
date - current date time

getPopularity

public int getPopularity()
Description copied from interface: IReputation
Retrieve the popularity of the player in the city

Specified by:
getPopularity in interface IReputation
Returns:


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