Class StorageHelperExtensions
Extension methods to provide static calls for ItemsContainer into ItemStorageHelper methods.
public static class StorageHelperExtensions
- Inheritance
-
StorageHelperExtensions
- Inherited Members
Methods
GetAllowedTechTypes(ItemsContainer)
Gets the set of techtypes allowed in this container. This set can be altered.
If the set is null or empty, then all items can be added.
public static HashSet<TechType> GetAllowedTechTypes(ItemsContainer container)
Parameters
containerItemsContainer- The container to check.
Returns
- HashSet<TechType>
- The collection of techtypes allowed in the container.
GetStorageLabel(ItemsContainer)
Get the inernal label for the storage container.
public static string GetStorageLabel(ItemsContainer container)
Parameters
containerItemsContainer- The container.
Returns
- string
- The label used and displayed in-game for the container.
GetTotalSlots(ItemsContainer)
The totals number of 1x1 slots in the container, as calculated by the container's width and height.
public static int GetTotalSlots(ItemsContainer container)
Parameters
containerItemsContainer- The container.
Returns
HasRoomCached(ItemsContainer, int, int)
Using the cached container info, determines whether the specified container has room for an item of the specified size.
public static bool HasRoomCached(this ItemsContainer container, int width, int height)
Parameters
containerItemsContainer- The container to check.
widthint- The item width.
heightint- The item height.
Returns
- bool
trueif there is room for the item in the container,; otherwise,false.
HasRoomCached(ItemsContainer, Vector2int)
Using the cached container info, determines whether the specified container has room for an item of the specified size.
public static bool HasRoomCached(this ItemsContainer container, Vector2int itemSize)
Parameters
containerItemsContainer- The container to check.
itemSizeVector2int- Size of the item.
Returns
- bool
trueif there is room for the item in the container,; otherwise,false.
IsEmpty(ItemsContainer)
Determines whether the specified container is empty.
public static bool IsEmpty(this ItemsContainer container)
Parameters
containerItemsContainer- The items container to check.
Returns
- bool
trueif the specified container is empty; otherwise,false.
IsFull(ItemsContainer)
Determines whether the specified container is full.
public static bool IsFull(this ItemsContainer container)
Parameters
containerItemsContainer- The items container to check.
Returns
- bool
trueif the specified container is full; otherwise,false.