Class Reputation

  • All Implemented Interfaces:
    IReputation

    public class Reputation
    extends java.lang.Object
    implements IReputation
    Implementation of the reputation.
    Author:
    Andi Hotz, (c) Sahits GmbH, 2012 Created on Jul 23, 2012
    • Field Detail

      • reputationLastWeek

        private int reputationLastWeek
      • reputationCurrentWeek

        private int reputationCurrentWeek
      • city

        private final ICity city
      • player

        private final IPlayer player
    • 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:
        reputation change in the last week
      • addWareReputation

        public void addWareReputation​(int wareReputation)
        Description copied from interface: IReputation
        Update the reputation with the reputation change by supplying wares.
        Specified by:
        addWareReputation in interface IReputation
        Parameters:
        wareReputation - reputation bonus by ware delivery.
      • 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:
        current popularity in the city this instance is assigned to
      • update

        public void update​(int amount)
        Description copied from interface: IReputation
        Update the reputation by the amount.
        Specified by:
        update in interface IReputation
        Parameters:
        amount - new reputation amount.