Package horizons :: Package world :: Module storage :: Class PositiveSizedSpecializedStorage
[hide private]
[frames] | no frames]

Class PositiveSizedSpecializedStorage

source code

    util.changelistener.ChangeListener --+        
                            GenericStorage --+    
                               PositiveStorage --+
util.changelistener.ChangeListener --+           |
                                     |           |
                        GenericStorage --+       |
                                         |       |
                        SpecializedStorage --+   |
                                             |   |
                       SizedSpecializedStorage --+

Instance Methods [hide private]
    Inherited from PositiveStorage
alter(self, res, amount)
alter() will return the amount of resources that did not fit into the storage or if altering in a negative way to remove resources, the amount of resources that was not available in the storage.
source code
    Inherited from GenericStorage
__getitem__(self, res) source code
__init__(self) source code
__str__(self) source code
Returns a dump of the inventory as dict
source code
get_free_space_for(self, res)
Returns how much of res we can still store here (limit - current amount).
source code
get_limit(self, res=None)
Returns the current limit of the storage.
source code
get_sum_of_stored_resources(self) source code
itercontents(self) source code
iterslots(self) source code
load(self, db, ownerid) source code
reset(self, res)
Resets a resource slot to zero, removing all its contents.
source code
Removes every resource from this inventory
source code
save(self, db, ownerid) 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
end(self) source code
has_change_listener(self, listener) source code
has_remove_listener(self, listener) source code
remove(self) source code
remove_change_listener(self, listener) source code
remove_remove_listener(self, listener) source code
    Inherited from SizedSpecializedStorage
add_resource_slot(self, res, size)
Add a resource slot for res that can hold at most *size* units.
source code
    Inherited from SpecializedStorage
has_resource_slot(self, res) source code
Class Variables [hide private]
    Inherited from util.changelistener.ChangeListener
  log = <logging.Logger object>