Package horizons :: Package world :: Package building :: Module buildingresourcehandler :: Class BuildingResourceHandler
[hide private]
[frames] | no frames]

Class BuildingResourceHandler

source code

resourcehandler.ResourceTransferHandler --+    
            resourcehandler.ResourceHandler --+

A Resourcehandler that is also a building. This class exists because we keep a list of all buildings, that provide something at the island.

Instance Methods [hide private]
__init__(self, island, **kwargs) source code
initialize(self) source code
__init(self) source code
load(self, db, worldid) source code
remove(self) source code
on_production_finished(self, caller, resources) source code
is_valid_tradable_resource(self, resources)
Checks if the produced resource tradable (can be carried by collectors).
source code
_set_running_costs_to_status(self, caller, activate) source code
    Inherited from resourcehandler.ResourceHandler
Returns the inventory of the owner to be able to retrieve special resources such as gold.
source code
Returns a iterable obj containing all resources this building provides.
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_consumed_resources(self, include_inactive=False)
Returns the needed resources that are used by the productions currently active.
source code
Returns a list of resources, that are currently consumed in a production.
source code
Needed, but not currently consumed resources.
source code
Returns list of resources, where free space in the inventory exists.
source code
Returns the resources, that are produced by productions, that are currently active
source code
Returns provided resources, where at least 1 ton is available
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_incoming_collector(self, collector) source code
save(self, db) source code
    Inherited from resourcehandler.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.ResourceHandler
  tabs = ProductionOverviewTab, InventoryTab
Method Details [hide private]

__init__(self, island, **kwargs)

source code 
Overrides: resourcehandler.ResourceHandler.__init__


source code 
Overrides: resourcehandler.ResourceHandler.initialize

load(self, db, worldid)

source code 
Overrides: resourcehandler.ResourceHandler.load


source code 
Overrides: resourcehandler.ResourceHandler.remove