Package horizons :: Package world :: Module player :: Class HumanPlayer
[hide private]
[frames] | no frames]

Class HumanPlayer

source code

component.componentholder.ComponentHolder --+    
   util.changelistener.ChangeListener --+   |    
                                        |   |    
             util.worldobject.WorldObject --+    
                                       Player --+

Class for players that physically sit in front of the machine where the game is run

Instance Methods [hide private]
__init(self, *args, **kwargs) source code
end(self) source code
    Inherited from Player
__init__(self, session, worldid, name, color, clientid=None, difficulty_level=None) source code
_load(self, db, worldid)
This function makes it possible to load playerdata into an already allocated Player instance, which is used e.g.
source code
This takes a while to calculate, so only do it every 2 seconds at most
source code
get_latest_stats(self) source code
Returns a namedtuple containing player-wide statistics
source code
initialize(self, inventory)
Has to be called every time a componentholder is created.
source code
is_local_player(self) source code
notify_settler_reached_level(self, message)
Settler calls this to notify the player.
source code
save(self, db) source code
Calculate settlements dynamically to save having a redundant list here
source code
    Inherited from component.componentholder.ComponentHolder
add_component(self, component)
Adds new component to holder and sets the instance attribute on the component
source code
get_component(self, component) source code
get_component_by_name(self, name) source code
has_component(self, component_class)
Check if holder has component with component name
source code
remove(self) source code
remove_component(self, component_class)
Removes component from holder.
source code
    Inherited from util.worldobject.WorldObject
__lt__(self, other) source code
    Inherited from util.changelistener.ChangeListener
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
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
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 Player
load(cls, session, db, worldid) source code
    Inherited from component.componentholder.ComponentHolder
get_component_template(cls, component)
Returns the component template data given a component NAME
source code
    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]
    Inherited from Player
  component_templates = {'StorageComponent': {'PositiveStorage':...
  regular_player = True
    Inherited from component.componentholder.ComponentHolder
  class_mapping = {'AmbientSoundComponent': AmbientSoundComponen...
    Inherited from util.worldobject.WorldObject
  log = logging.getLogger("util.worldobject")
Method Details [hide private]


source code 
Overrides: util.changelistener.ChangeListener.end