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

Detailed Description

item container that combines different ItemStorages that are each meant for one specific item
used in the ProductionComponent where storage is split between different producers and consumers

Inheritance diagram for CityBuilderCore.SplitItemContainer:
CityBuilderCore.IItemContainer

Public Member Functions

 SplitItemContainer (IEnumerable< ItemStorage > storages, Func< Item, ItemStorage > itemStorageGetter)
 
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.SplitItemContainer.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)

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

Implements CityBuilderCore.IItemContainer.

◆ GetItemCapacity() [1/3]

int CityBuilderCore.SplitItemContainer.GetItemCapacity ( )

◆ GetItemCapacity() [2/3]

int CityBuilderCore.SplitItemContainer.GetItemCapacity ( Item item)

◆ GetItemCapacity() [3/3]

int CityBuilderCore.SplitItemContainer.GetItemCapacity ( ItemCategory itemCategory)

◆ GetItemCapacityRemaining() [1/3]

int CityBuilderCore.SplitItemContainer.GetItemCapacityRemaining ( )

◆ GetItemCapacityRemaining() [2/3]

int CityBuilderCore.SplitItemContainer.GetItemCapacityRemaining ( Item item)

◆ GetItemCapacityRemaining() [3/3]

int CityBuilderCore.SplitItemContainer.GetItemCapacityRemaining ( ItemCategory itemCategory)

◆ GetItemQuantities()

IEnumerable< ItemQuantity > CityBuilderCore.SplitItemContainer.GetItemQuantities ( )

◆ GetItemQuantity() [1/3]

int CityBuilderCore.SplitItemContainer.GetItemQuantity ( )

◆ GetItemQuantity() [2/3]

int CityBuilderCore.SplitItemContainer.GetItemQuantity ( Item item)

◆ GetItemQuantity() [3/3]

int CityBuilderCore.SplitItemContainer.GetItemQuantity ( ItemCategory itemCategory)

◆ GetItems()

IEnumerable< Item > CityBuilderCore.SplitItemContainer.GetItems ( )

◆ RemoveItems()

int CityBuilderCore.SplitItemContainer.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)

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

Implements CityBuilderCore.IItemContainer.

◆ ReserveCapacity()

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

◆ ReserveQuantity()

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

◆ UnreserveCapacity()

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

◆ UnreserveQuantity()

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