Package horizons :: Package world :: Module playerstats :: Class PlayerStats
[hide private]
[frames] | no frames]

Class PlayerStats

source code

util.changelistener.ChangeListener --+    
                                     |    
          util.worldobject.WorldObject --+
                                         |
                                        PlayerStats

Instance Methods [hide private]
 
__init__(self, player) source code
 
_collect_info(self) source code
 
_calculate_settler_score(self, settlers, settler_buildings, settler_resources_provided) source code
 
_calculate_building_score(self, buildings) source code
 
_calculate_resource_score(self, available_resources, total_resources) source code
 
_calculate_unit_score(self, ships) source code
 
_calculate_land_score(self, usable_land, settlements) source code
 
_calculate_money_score(self, running_costs, taxes, money) source code
 
_calculate_total_score(self) source code
    Inherited from util.worldobject.WorldObject
 
__lt__(self, other) source code
 
load(self, db, worldid) source code
 
remove(self) source code
 
save(self, db) source code
    Inherited from util.changelistener.ChangeListener
 
_changed(self)
Calls every listener when an object changed
source code
 
add_change_listener(self, listener, call_listener_now=False, no_duplicates=False) source code
 
add_remove_listener(self, listener, no_duplicates=False)
A listener that listens for removal of the object
source code
 
clear_change_listeners(self)
Removes all change listeners
source code
 
discard_change_listener(self, listener)
Remove listener if it's there
source code
 
discard_remove_listener(self, listener) source code
 
end(self) source code
 
has_change_listener(self, listener) source code
 
has_remove_listener(self, listener) source code
 
remove_change_listener(self, listener) source code
 
remove_remove_listener(self, listener) source code
Class Methods [hide private]
    Inherited from util.worldobject.WorldObject
 
get_object_by_id(cls, id)
Returns the worldobject with id id Throws WorldObjectNotFound with the worldid as arg.
source code
 
get_objs(cls) source code
 
reset(cls) source code
Class Variables [hide private]
  settler_values = {TIER.SAILORS: 2, TIER.PIONEERS: 3, TIER.SETT...
  settler_building_values = {TIER.SAILORS: 3, TIER.PIONEERS: 5, ...
  settler_resource_provided_coefficient = 0.1
  settler_score_coefficient = 0.3
  building_score_coefficient = 0.006
  unavailable_resource_coefficient = 0.3
  overridden_resource_values = {RES.RAW_CLAY: 1, RES.RAW_IRON: 3}
  resource_score_coefficient = 0.01
  unit_value = {UNITS.FRIGATE: 1.5, UNITS.PLAYER_SHIP: 1, UNITS....
  unit_score_coefficient = 10
  settlement_value = 30
  land_score_coefficient = 0.03
  running_cost_coefficient = 10
  minimum_money = 500
  money_power = 0.4
  money_score_coefficient = 1.3
    Inherited from util.worldobject.WorldObject
  log = logging.getLogger("util.worldobject")
Method Details [hide private]

__init__(self, player)
(Constructor)

source code 
Parameters:
  • worldid - worldid to assign. Use None to get an autogenerated one.
Overrides: util.changelistener.ChangeListener.__init__

Class Variable Details [hide private]

settler_values

Value:
{TIER.SAILORS: 2, TIER.PIONEERS: 3, TIER.SETTLERS: 7, TIER.CITIZENS: 1\
5,}

settler_building_values

Value:
{TIER.SAILORS: 3, TIER.PIONEERS: 5, TIER.SETTLERS: 11, TIER.CITIZENS: \
19,}

unit_value

Value:
{UNITS.FRIGATE: 1.5, UNITS.PLAYER_SHIP: 1, UNITS.USABLE_FISHER_BOAT: 1\
, UNITS.FISHER_BOAT: 0.05}