Package horizons :: Package world :: Package production :: Module producer :: Class ShipProducer
[hide private]
[frames] | no frames]

Class ShipProducer

source code

component.Component --+        
                      |        
               Producer --+    
                          |    
              QueueProducer --+
                              |
                             ShipProducer

Uses queues to produce naval units

Instance Methods [hide private]
 
get_unit_production_queue(self)
Returns a list unit type ids that are going to be produced.
source code
 
on_queue_element_finished(self, production)
Callback used for the SingleUseProduction
source code
 
__create_unit(self)
Create the produced unit now.
source code
 
_place_unit(self, unit) source code
    Inherited from QueueProducer
 
__init__(self, **kwargs)
Used for initialization code that does not require any other components.
source code
 
add_production_by_id(self, production_line_id)
Convenience method.
source code
 
cancel_all_productions(self) source code
 
cancel_current_production(self)
Cancels the current production and proceeds to the next one, if there is one
source code
 
check_next_production_startable(self) source code
 
load(self, db, worldid)
This does on load what __init() and initalize() together do on constructions at runtime.
source code
 
remove_from_queue(self, index)
Remove the index'th element from the queue.
source code
 
save(self, db)
Will do nothing, but will be always called in componentholder code, even if not implemented.
source code
 
start_next_production(self)
Starts the next production that is in the queue, if there is one.
source code
    Inherited from Producer
 
__str__(self) source code
 
_add_status_icon(self, icon) source code
 
_get_current_state(self)
Returns the current state of the producer.
source code
 
_get_production(self, prod_line_id)
Returns a production of this producer by a production line id.
source code
 
_on_production_change(self)
Makes the instance act according to the producers current state
source code
 
_production_finished(self, production)
Gets called when a production finishes.
source code
 
_update_decommissioned_icon(self)
Add or remove decommissioned icon.
source code
 
add_production(self, production) source code
 
alter_production_time(self, modifier, prod_line_id=None)
Multiplies the original production time of all production lines by modifier
source code
 
capacity_utilization(self) source code
 
capacity_utilization_below(self, limit) source code
 
create_production(self, id, load=False) source code
 
create_production_line(self, id)
Creates a production line instance, this is meant only for data transfer and READONLY use! If you want to use production lines for anything else, go the proper way of the production class.
source code
 
finish_production_now(self)
Cheat, makes current production finish right now (and produce the resources).
source code
 
get_production_lines(self)
Returns all production lines that have been added.
source code
 
get_production_lines_by_level(self, level) source code
 
get_production_progress(self)
Returns the current progress of the active production.
source code
 
get_productions(self)
Returns all productions, inactive and active ones, as list
source code
 
get_status_icons(self) source code
 
has_production_line(self, prod_line_id)
Checks if this instance has a production with a certain production line id
source code
 
initialize(self)
This is called by the ComponentHolder after it set the instance.
source code
 
is_active(self, production=None)
Checks if a production, or the at least one production if production is None, is active
source code
 
remove(self)
Removes component and reference to instance
source code
 
remove_production(self, production)
Removes a production instance.
source code
 
remove_production_by_id(self, prod_line_id)
Convenience method.
source code
 
set_active(self, production=None, active=True)
Pause or unpause a production (aka set it active/inactive).
source code
 
toggle_active(self, production=None) source code
 
update_capacity_utilization(self)
Called by the scheduler to update the utilization regularly
source code
    Inherited from component.Component
 
__gt__(self, other) source code
 
__lt__(self, other) source code
Class Methods [hide private]
    Inherited from Producer
 
get_instance(cls, arguments=None)
This function is used to instantiate classes from yaml data.
source code
Class Variables [hide private]
  produces_resource = False
  production_class = UnitProduction
    Inherited from Producer
  DEPENDENCIES = [StorageComponent]
  NAME = "producer"
hash(x)
  log = logging.getLogger("world.production")
  utilization_mapping = {'FieldUtilization': FieldUtilization, '...
Properties [hide private]
    Inherited from component.Component
  session
Method Details [hide private]

get_unit_production_queue(self)

source code 

Returns a list unit type ids that are going to be produced. Does not include the currently produced unit. List is in order.

on_queue_element_finished(self, production)

source code 

Callback used for the SingleUseProduction

Overrides: QueueProducer.on_queue_element_finished
(inherited documentation)