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

Module storage

source code


Here we define how the inventories work, that are used by world objects.
These storage classes exist:

- GenericStorage (abstract): Defines general interface for storage.

Storages with certain properties:
- PositiveStorage: Doesn't allow negative values.
- TotalStorage: Sum of all stored res must be <= a certain limit.
- SpecializedStorage: Allows only certain resources to be stored here.
- SizedSpecializedStorage: Like SpecializedStorage, but each res has an own limit.

Combinations:
- SizedSlottedStorage: One limit, each res value must be <= the limit and >= 0.
- PositiveTotalStorage: use case: ship inventory
- PositiveSizedSlotStorage: every res has the same limit, only positive values (warehouse, collectors)
- PositiveSizedSpecializedStorage: Like SizedSpecializedStorage, plus only positive values.

Classes [hide private]
  GenericStorage
The GenericStorage represents a storage for buildings/units/players/etc.
  SpecializedStorage
Storage where only certain resources can be stored.
  SizedSpecializedStorage
Just like SpecializedStorage, but each res has an own limit.
  GlobalLimitStorage
Storage with some kind of global limit.
  TotalStorage
The TotalStorage represents a storage with a general limit to the sum of resources that can be stored in it.
  PositiveStorage
The positive storage doesn't allow to have negative values for resources.
  PositiveTotalStorage
A combination of the Total and Positive storage.
  PositiveTotalNumSlotsStorage
A combination of the Total and Positive storage which only has a limited number of slots.
  PositiveSizedSlotStorage
A storage consisting of a slot for each resource, all slots have the same size 'limit' Used by the warehouse for example.
  PositiveSizedSpecializedStorage
  PositiveSizedNumSlotStorage
A storage consisting of a number of slots, all slots have the same size 'limit'.
  SettlementStorage
Dummy class to signal the storagecomponent to use the settlements inventory