Loading...
Searching...
No Matches
CityBuilderCore.IItemContainer Interface Reference

Detailed Description

interface for classes that hold and manage items, the most common implementation is ItemStorage
SplitItemContainer and MultiItemContainer were created so components with more than one storage can act the same as if they only had one

Inheritance diagram for CityBuilderCore.IItemContainer:
CityBuilderCore.ItemStorage CityBuilderCore.MultiItemContainer CityBuilderCore.SplitItemContainer

Public Member Functions

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 item)
 
int GetItemCapacity ()
 
int GetItemCapacity (Item item)
 
int GetItemCapacity (ItemCategory item)
 
int GetItemCapacityRemaining ()
 
int GetItemCapacityRemaining (Item item)
 
int GetItemCapacityRemaining (ItemCategory item)
 
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.IItemContainer.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

Implemented in CityBuilderCore.ItemStorage, CityBuilderCore.MultiItemContainer, and CityBuilderCore.SplitItemContainer.

◆ GetItemCapacity() [1/3]

int CityBuilderCore.IItemContainer.GetItemCapacity ( )

Implemented in CityBuilderCore.ItemStorage.

◆ GetItemCapacity() [2/3]

int CityBuilderCore.IItemContainer.GetItemCapacity ( Item item)

Implemented in CityBuilderCore.ItemStorage.

◆ GetItemCapacity() [3/3]

int CityBuilderCore.IItemContainer.GetItemCapacity ( ItemCategory item)

Implemented in CityBuilderCore.ItemStorage.

◆ GetItemCapacityRemaining() [1/3]

int CityBuilderCore.IItemContainer.GetItemCapacityRemaining ( )

Implemented in CityBuilderCore.ItemStorage.

◆ GetItemCapacityRemaining() [2/3]

int CityBuilderCore.IItemContainer.GetItemCapacityRemaining ( Item item)

Implemented in CityBuilderCore.ItemStorage.

◆ GetItemCapacityRemaining() [3/3]

int CityBuilderCore.IItemContainer.GetItemCapacityRemaining ( ItemCategory item)

Implemented in CityBuilderCore.ItemStorage.

◆ GetItemQuantities()

IEnumerable< ItemQuantity > CityBuilderCore.IItemContainer.GetItemQuantities ( )

Implemented in CityBuilderCore.ItemStorage.

◆ GetItemQuantity() [1/3]

int CityBuilderCore.IItemContainer.GetItemQuantity ( )

Implemented in CityBuilderCore.ItemStorage.

◆ GetItemQuantity() [2/3]

int CityBuilderCore.IItemContainer.GetItemQuantity ( Item item)

Implemented in CityBuilderCore.ItemStorage.

◆ GetItemQuantity() [3/3]

int CityBuilderCore.IItemContainer.GetItemQuantity ( ItemCategory item)

Implemented in CityBuilderCore.ItemStorage.

◆ GetItems()

IEnumerable< Item > CityBuilderCore.IItemContainer.GetItems ( )

Implemented in CityBuilderCore.ItemStorage.

◆ RemoveItems()

int CityBuilderCore.IItemContainer.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

Implemented in CityBuilderCore.ItemStorage, CityBuilderCore.MultiItemContainer, and CityBuilderCore.SplitItemContainer.

◆ ReserveCapacity()

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

Implemented in CityBuilderCore.ItemStorage.

◆ ReserveQuantity()

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

Implemented in CityBuilderCore.ItemStorage.

◆ UnreserveCapacity()

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

Implemented in CityBuilderCore.ItemStorage.

◆ UnreserveQuantity()

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

Implemented in CityBuilderCore.ItemStorage.