Loading...
Searching...
No Matches
CityBuilderCore.MultiItemContainer Class Reference

Detailed Description

item container that combines different ItemStorages
used in the EvolutionComponent in which storage is split among the different recipients

Inheritance diagram for CityBuilderCore.MultiItemContainer:
CityBuilderCore.IItemContainer

Public Member Functions

 MultiItemContainer (IEnumerable< ItemStorage > storages, Func< Item, IEnumerable< ItemStorage > > itemStoragesGetter, Func< ItemCategory, IEnumerable< ItemStorage > > itemCategoryStoragesGetter)
 
void ReserveCapacity (Item item, int amount)
 
void UnreserveCapacity (Item item, int amount)
 
void ReserveQuantity (Item item, int amount)
 
void UnreserveQuantity (Item item, int amount)
 
IEnumerable< ItemGetItems ()
 
IEnumerable< ItemQuantityGetItemQuantities ()
 
int GetItemQuantity ()
 
int GetItemQuantity (Item item)
 
int GetItemQuantity (ItemCategory itemCategory)
 
int GetItemCapacity ()
 
int GetItemCapacity (Item item)
 
int GetItemCapacity (ItemCategory itemCategory)
 
int GetItemCapacityRemaining ()
 
int GetItemCapacityRemaining (Item item)
 
int GetItemCapacityRemaining (ItemCategory itemCategory)
 
int AddItems (Item item, int quantity)
 adds items to that storage up to its capacity, remaining quantity is returned
(adding 10 items to a storage that can only fit 4 more will return 6)
 
int RemoveItems (Item item, int quantity)
 removes items from storage and returns the remaining quantity if not enough items were present
(removing 4 items from a store that contains only 3 will return 1)
 

Member Function Documentation

◆ AddItems()

int CityBuilderCore.MultiItemContainer.AddItems ( Item item,
int quantity )
inline

adds items to that storage up to its capacity, remaining quantity is returned
(adding 10 items to a storage that can only fit 4 more will return 6)

Parameters
itemthe item to add
quantitymaximum quantity to add
Returns
remaining quantity that did not fit

Implements CityBuilderCore.IItemContainer.

◆ GetItemCapacity() [1/3]

int CityBuilderCore.MultiItemContainer.GetItemCapacity ( )

◆ GetItemCapacity() [2/3]

int CityBuilderCore.MultiItemContainer.GetItemCapacity ( Item item)

◆ GetItemCapacity() [3/3]

int CityBuilderCore.MultiItemContainer.GetItemCapacity ( ItemCategory itemCategory)

◆ GetItemCapacityRemaining() [1/3]

int CityBuilderCore.MultiItemContainer.GetItemCapacityRemaining ( )

◆ GetItemCapacityRemaining() [2/3]

int CityBuilderCore.MultiItemContainer.GetItemCapacityRemaining ( Item item)

◆ GetItemCapacityRemaining() [3/3]

int CityBuilderCore.MultiItemContainer.GetItemCapacityRemaining ( ItemCategory itemCategory)

◆ GetItemQuantities()

IEnumerable< ItemQuantity > CityBuilderCore.MultiItemContainer.GetItemQuantities ( )

◆ GetItemQuantity() [1/3]

int CityBuilderCore.MultiItemContainer.GetItemQuantity ( )

◆ GetItemQuantity() [2/3]

int CityBuilderCore.MultiItemContainer.GetItemQuantity ( Item item)

◆ GetItemQuantity() [3/3]

int CityBuilderCore.MultiItemContainer.GetItemQuantity ( ItemCategory itemCategory)

◆ GetItems()

IEnumerable< Item > CityBuilderCore.MultiItemContainer.GetItems ( )

◆ RemoveItems()

int CityBuilderCore.MultiItemContainer.RemoveItems ( Item item,
int quantity )
inline

removes items from storage and returns the remaining quantity if not enough items were present
(removing 4 items from a store that contains only 3 will return 1)

Parameters
itemthe item to remove
quantitythe maximum quantity to remove
Returns
remaining quantity not removed

Implements CityBuilderCore.IItemContainer.

◆ ReserveCapacity()

void CityBuilderCore.MultiItemContainer.ReserveCapacity ( Item item,
int amount )

◆ ReserveQuantity()

void CityBuilderCore.MultiItemContainer.ReserveQuantity ( Item item,
int amount )

◆ UnreserveCapacity()

void CityBuilderCore.MultiItemContainer.UnreserveCapacity ( Item item,
int amount )

◆ UnreserveQuantity()

void CityBuilderCore.MultiItemContainer.UnreserveQuantity ( Item item,
int amount )