Package horizons :: Package world :: Module resourcehandler :: Class StorageResourceHandler
[hide private]
[frames] | no frames]

Class StorageResourceHandler

source code

ResourceTransferHandler --+    
                          |    
            ResourceHandler --+
                              |
                             StorageResourceHandler

Same as ResourceHandler, but for storage buildings such as warehouses. Provides all tradeable resources.

Instance Methods [hide private]
 
get_consumed_resources(self)
We collect everything we provide
source code
 
_load_provided_resources(self)
Storages provide every res.
source code
    Inherited from ResourceHandler
 
__init__(self, **kwargs) source code
 
_get_owner_inventory(self)
Returns the inventory of the owner to be able to retrieve special resources such as gold.
source code
 
add_incoming_collector(self, collector) source code
 
get_available_pickup_amount(self, res, collector)
Returns how much of res a collector may pick up.
source code
 
get_currently_consumed_resources(self)
Returns a list of resources, that are currently consumed in a production.
source code
 
get_currently_not_consumed_resources(self)
Needed, but not currently consumed resources.
source code
 
get_needed_resources(self)
Returns list of resources, where free space in the inventory exists.
source code
 
get_produced_resources(self)
Returns the resources, that are produced by productions, that are currently active
source code
 
get_stocked_provided_resources(self)
Returns provided resources, where at least 1 ton is available
source code
 
initialize(self) source code
 
load(self, db, worldid) source code
 
pickup_resources(self, res, amount, collector)
Try to get amount number of resources of id res_id that are in stock and removes them from the stock.
source code
 
remove(self) source code
 
remove_incoming_collector(self, collector) source code
 
save(self, db) source code
    Inherited from ResourceTransferHandler
 
transfer_to_storageholder(self, amount, res_id, transfer_to, signal_errors=False)
Transfers amount of res_id to transfer_to.
source code
Class Variables [hide private]
    Inherited from ResourceHandler
  tabs = ProductionOverviewTab, InventoryTab
Method Details [hide private]

get_consumed_resources(self)

source code 

We collect everything we provide

Overrides: ResourceHandler.get_consumed_resources

_load_provided_resources(self)

source code 

Storages provide every res. Do not alter the returned list; if you need to do so, then copy it.

Overrides: ResourceHandler._load_provided_resources