Inventory
Barotrauma.Inventory
Functions
ApplyReceivedState()
ApplyReceivedState
CanBePut(itemPrefab, condition, quality)
CanBePut
Parameters
-
itemPrefab
ItemPrefab
-
condition
optional Single
-
quality
optional Int32
Returns
-
bool
CanBePut(item)
CanBePut
Parameters
-
item
Item
Returns
-
bool
CanBePutInSlot(itemPrefab, i, condition, quality)
CanBePutInSlot
Parameters
-
itemPrefab
ItemPrefab
-
i
number
-
condition
optional Single
-
quality
optional Int32
Returns
-
bool
CanBePutInSlot(item, i, ignoreCondition)
CanBePutInSlot
Parameters
-
item
Item
-
i
number
-
ignoreCondition
bool
Returns
-
bool
ClearSubInventories()
ClearSubInventories
ClientEventRead(msg)
ClientEventRead
Parameters
-
msg
Networking.IReadMessage
Contains(item)
Contains
Parameters
-
item
Item
Returns
-
bool
CreateNetworkEvent()
CreateNetworkEvent
CreateSlots()
CreateSlots
DeleteAllItems()
DeleteAllItems
Draw(spriteBatch, subInventory)
Draw
Parameters
-
spriteBatch
Microsoft.Xna.Framework.Graphics.SpriteBatch
-
subInventory
bool
DrawSubInventory(spriteBatch, slotIndex)
DrawSubInventory
Parameters
-
spriteBatch
Microsoft.Xna.Framework.Graphics.SpriteBatch
-
slotIndex
number
Equals(obj)
Equals
Parameters
-
obj
Object
Returns
-
bool
FindAllItems(predicate, recursive, list)
FindAllItems
Parameters
-
predicate
function
-
recursive
bool
-
list
table
Returns
FindAllowedSlot(item, ignoreCondition)
FindAllowedSlot
Parameters
-
item
Item
-
ignoreCondition
bool
Returns
-
number
FindIndex(item)
FindIndex
Parameters
-
item
Item
Returns
-
number
FindIndices(item)
FindIndices
Parameters
-
item
Item
Returns
FindItem(predicate, recursive)
FindItem
Parameters
-
predicate
function
-
recursive
bool
Returns
-
Item
FindItemByIdentifier(identifier, recursive)
FindItemByIdentifier
Parameters
-
identifier
Identifier
-
recursive
bool
Returns
-
Item
FindItemByTag(tag, recursive)
FindItemByTag
Parameters
-
tag
Identifier
-
recursive
bool
Returns
-
Item
FirstOrDefault()
FirstOrDefault
Returns
-
Item
ForceRemoveFromSlot(item, index)
ForceRemoveFromSlot
Parameters
-
item
Item
-
index
number
ForceToSlot(item, index)
ForceToSlot
Parameters
-
item
Item
-
index
number
GetAllItems(checkForDuplicates)
GetAllItems
Parameters
-
checkForDuplicates
bool
Returns
-
IEnumerable
GetHashCode()
GetHashCode
Returns
-
number
GetItemAt(index)
GetItemAt
Parameters
-
index
number
Returns
-
Item
GetItemStackSlotIndex(item, index)
GetItemStackSlotIndex
Parameters
-
item
Item
-
index
number
Returns
-
number
GetItemsAt(index)
GetItemsAt
Parameters
-
index
number
Returns
-
IEnumerable
GetReplacementOrThiS()
GetReplacementOrThiS
Returns
GetType()
GetType
Returns
-
Type
HideSlot(i)
HideSlot
Parameters
-
i
number
Returns
-
bool
HowManyCanBePut(itemPrefab, condition)
HowManyCanBePut
Parameters
-
itemPrefab
ItemPrefab
-
condition
optional Single
Returns
-
number
HowManyCanBePut(itemPrefab, i, condition, ignoreItemsInSlot)
HowManyCanBePut
Parameters
-
itemPrefab
ItemPrefab
-
i
number
-
condition
optional Single
-
ignoreItemsInSlot
bool
Returns
-
number
Inventory(owner, capacity, slotsPerRow)
Inventory
Parameters
-
owner
Entity
-
capacity
number
-
slotsPerRow
number
Inventory.DrawFront(spriteBatch)
DrawFront
Parameters
-
spriteBatch
Microsoft.Xna.Framework.Graphics.SpriteBatch
Inventory.DrawSlot(spriteBatch, inventory, slot, item, slotIndex, drawItem, type)
DrawSlot
Parameters
-
spriteBatch
Microsoft.Xna.Framework.Graphics.SpriteBatch
-
inventory
Inventory
-
slot
VisualSlot
-
item
Item
-
slotIndex
number
-
drawItem
bool
-
type
InvSlotType
Inventory.GetInventoryMouseCursor()
GetInventoryMouseCursor
Returns
-
CursorState
Inventory.IsMouseOnSlot(slot)
IsMouseOnSlot
Parameters
-
slot
VisualSlot
Returns
-
bool
Inventory.RefreshMouseOnInventory()
RefreshMouseOnInventory
Inventory.UpdateDragging()
UpdateDragging
IsEmpty()
IsEmpty
Returns
-
bool
IsFull(takeStacksIntoAccount)
IsFull
Parameters
-
takeStacksIntoAccount
bool
Returns
-
bool
IsInSlot(item, index)
IsInSlot
Parameters
-
item
Item
-
index
number
Returns
-
bool
IsInventoryHoverAvailable(owner, container)
IsInventoryHoverAvailable
Parameters
-
owner
Character
-
container
Items.Components.ItemContainer
Returns
-
bool
ItemOwnsSelf(item)
ItemOwnsSelf
Parameters
-
item
Item
Returns
-
bool
LastOrDefault()
LastOrDefault
Returns
-
Item
Movable()
Movable
Returns
-
bool
RemoveItem(item)
RemoveItem
Parameters
-
item
Item
ServerEventRead(msg, sender)
ServerEventRead
Parameters
-
msg
Networking.IReadMessage
-
sender
Networking.Client
ToString()
ToString
Returns
TryPutItem(item, user, allowedSlots, createNetworkEvent, ignoreCondition)
TryPutItem
Parameters
-
item
Item
-
user
Character
-
allowedSlots
IEnumerable
-
createNetworkEvent
bool
-
ignoreCondition
bool
Returns
-
bool
TryPutItem(item, i, allowSwapping, allowCombine, user, createNetworkEvent, ignoreCondition)
TryPutItem
Parameters
-
item
Item
-
i
number
-
allowSwapping
bool
-
allowCombine
bool
-
user
Character
-
createNetworkEvent
bool
-
ignoreCondition
bool
Returns
-
bool
Update(deltaTime, cam, subInventory)
Update
Parameters
-
deltaTime
number
-
cam
Camera
-
subInventory
bool
UpdateSubInventory(deltaTime, slotIndex, cam)
UpdateSubInventory
Parameters
-
deltaTime
number
-
slotIndex
number
-
cam
Camera
Fields
AllItems
AllItems, field of type IEnumerable
-
AllItems
AllItemsMod
AllItemsMod, field of type IEnumerable
-
AllItemsMod
AllowSwappingContainedItems
AllowSwappingContainedItems, field of type bool
-
AllowSwappingContainedItems
BackgroundFrame
BackgroundFrame, field of type Microsoft.Xna.Framework.Rectangle
-
BackgroundFrame
Capacity
Capacity, field of type number
-
Capacity
DrawWhenEquipped
DrawWhenEquipped, field of type bool
-
DrawWhenEquipped
EmptySlotCount
EmptySlotCount, field of type number
-
EmptySlotCount
ExtraStackSize
ExtraStackSize, field of type number
-
ExtraStackSize
HideTimer
HideTimer, field of type number
-
HideTimer
Inventory.ContainedIndicatorHeight
Inventory.ContainedIndicatorHeight, field of type number
Inventory.DraggableIndicator
Inventory.DraggableIndicator, field of type Sprite
Inventory.DraggingInventory
Inventory.DraggingInventory, field of type Inventory
Inventory.DraggingItemToWorld
Inventory.DraggingItemToWorld, field of type bool
Inventory.DraggingItems
Inventory.DraggingItems, field of type table
Inventory.DraggingSlot
Inventory.DraggingSlot, field of type VisualSlot
Inventory.EquippedClickedIndicator
Inventory.EquippedClickedIndicator, field of type Sprite
Inventory.EquippedHoverIndicator
Inventory.EquippedHoverIndicator, field of type Sprite
Inventory.EquippedIndicator
Inventory.EquippedIndicator, field of type Sprite
Inventory.IsDragAndDropGiveAllowed
Inventory.IsDragAndDropGiveAllowed, field of type bool
Inventory.IsMouseOnInventory
Inventory.IsMouseOnInventory, field of type bool
Inventory.MaxItemsPerNetworkEvent
Inventory.MaxItemsPerNetworkEvent, field of type number
Inventory.MaxPossibleStackSize
Inventory.MaxPossibleStackSize, field of type number
Inventory.SelectedSlot
Inventory.SelectedSlot, field of type SlotReference
Inventory.SlotSpriteSmall
Inventory.SlotSpriteSmall, field of type Sprite
Inventory.SlotSpriteSmallScale
Inventory.SlotSpriteSmallScale, field of type number
Inventory.UIScale
Inventory.UIScale, field of type number
Inventory.UnequippedClickedIndicator
Inventory.UnequippedClickedIndicator, field of type Sprite
Inventory.UnequippedHoverIndicator
Inventory.UnequippedHoverIndicator, field of type Sprite
Inventory.UnequippedIndicator
Inventory.UnequippedIndicator, field of type Sprite
Inventory.doubleClickedItems
Inventory.doubleClickedItems, field of type table
Locked
Locked, field of type bool
-
Locked
OpenState
OpenState, field of type number
-
OpenState
Owner
Owner, field of type Entity
-
Owner
RectTransform
RectTransform, field of type RectTransform
-
RectTransform
ReplacedBy
ReplacedBy, field of type Inventory
-
ReplacedBy
SlotsPerRow
SlotsPerRow, field of type number
-
SlotsPerRow
visualSlots
visualSlots, field of type VisualSlot[]
-
visualSlots