Barotrauma Client Doc
Barotrauma.Inventory.ItemSlot Class Reference

Public Member Functions

 ItemSlot (Inventory inventory)
 
bool CanBePut (Item item, bool ignoreCondition=false)
 
bool CanBePut (ItemPrefab itemPrefab, float? condition=null, int? quality=null)
 
int HowManyCanBePut (ItemPrefab itemPrefab, int? maxStackSize=null, float? condition=null, bool ignoreItemsInSlot=false)
 
Parameters
maxStackSizeDefaults to ItemPrefab.MaxStackSize if null
More...
 
void Add (Item item)
 
Item RemoveItem ()
 Removes one item from the slot More...
 
void RemoveItem (Item item)
 
void RemoveAllItems ()
 Removes all items from the slot More...
 
void RemoveWhere (Func< Item, bool > predicate)
 
bool Any ()
 
bool Empty ()
 
Item First ()
 
Item FirstOrDefault ()
 
Item LastOrDefault ()
 
bool Contains (Item item)
 

Public Attributes

bool HideIfEmpty
 

Properties

IReadOnlyList< ItemItems [get]
 

Detailed Description

Constructor & Destructor Documentation

◆ ItemSlot()

Barotrauma.Inventory.ItemSlot.ItemSlot ( Inventory  inventory)

Member Function Documentation

◆ Add()

void Barotrauma.Inventory.ItemSlot.Add ( Item  item)

◆ Any()

bool Barotrauma.Inventory.ItemSlot.Any ( )

◆ CanBePut() [1/2]

bool Barotrauma.Inventory.ItemSlot.CanBePut ( Item  item,
bool  ignoreCondition = false 
)

◆ CanBePut() [2/2]

bool Barotrauma.Inventory.ItemSlot.CanBePut ( ItemPrefab  itemPrefab,
float?  condition = null,
int?  quality = null 
)

◆ Contains()

bool Barotrauma.Inventory.ItemSlot.Contains ( Item  item)

◆ Empty()

bool Barotrauma.Inventory.ItemSlot.Empty ( )

◆ First()

Item Barotrauma.Inventory.ItemSlot.First ( )

◆ FirstOrDefault()

Item Barotrauma.Inventory.ItemSlot.FirstOrDefault ( )

◆ HowManyCanBePut()

int Barotrauma.Inventory.ItemSlot.HowManyCanBePut ( ItemPrefab  itemPrefab,
int?  maxStackSize = null,
float?  condition = null,
bool  ignoreItemsInSlot = false 
)

Parameters
maxStackSizeDefaults to ItemPrefab.MaxStackSize if null

Definition at line 101 of file BarotraumaShared/SharedSource/Items/Inventory.cs.

◆ LastOrDefault()

Item Barotrauma.Inventory.ItemSlot.LastOrDefault ( )

◆ RemoveAllItems()

void Barotrauma.Inventory.ItemSlot.RemoveAllItems ( )

Removes all items from the slot

Definition at line 187 of file BarotraumaShared/SharedSource/Items/Inventory.cs.

◆ RemoveItem() [1/2]

Item Barotrauma.Inventory.ItemSlot.RemoveItem ( )

Removes one item from the slot

Definition at line 170 of file BarotraumaShared/SharedSource/Items/Inventory.cs.

◆ RemoveItem() [2/2]

void Barotrauma.Inventory.ItemSlot.RemoveItem ( Item  item)

◆ RemoveWhere()

void Barotrauma.Inventory.ItemSlot.RemoveWhere ( Func< Item, bool >  predicate)

Member Data Documentation

◆ HideIfEmpty

bool Barotrauma.Inventory.ItemSlot.HideIfEmpty

Property Documentation

◆ Items

IReadOnlyList<Item> Barotrauma.Inventory.ItemSlot.Items
get