Class MyInventory
Inheritance
System.Object
MyInventory
Assembly: Sandbox.Game.dll
Syntax
[MyComponentBuilder]
[StaticEventOwner]
public class MyInventory : MyInventoryBase, IMyEntityComponentBase, IMyComponentBase, IMyEventProxy, IMyEventOwner, IMyInventory, IMyInventory
Constructors
MyInventory()
Declaration
MyInventory(Single, Single, Vector3, MyInventoryFlags)
Declaration
public MyInventory(float maxVolume, float maxMass, Vector3 size, MyInventoryFlags flags)
Parameters
MyInventory(Single, Vector3, MyInventoryFlags)
Declaration
public MyInventory(float maxVolume, Vector3 size, MyInventoryFlags flags)
Parameters
MyInventory(MyObjectBuilder_InventoryDefinition, MyInventoryFlags)
Declaration
public MyInventory(MyObjectBuilder_InventoryDefinition definition, MyInventoryFlags flags)
Parameters
MyInventory(MyFixedPoint, MyFixedPoint, MyInventoryFlags, List<MyPhysicalInventoryItem>)
Declaration
public MyInventory(MyFixedPoint maxVolume, MyFixedPoint maxMass, MyInventoryFlags flags, List<MyPhysicalInventoryItem> initialInventory)
Parameters
MyInventory(MyFixedPoint, MyFixedPoint, Vector3, MyInventoryFlags)
Declaration
public MyInventory(MyFixedPoint maxVolume, MyFixedPoint maxMass, Vector3 size, MyInventoryFlags flags)
Parameters
Fields
Constraint
Constraint filtering items added to inventory. If null, everything is allowed.
Note that setting this constraint will not affect items already in the inventory.
Declaration
public MyInventoryConstraint Constraint
Field Value
ExternalMass
Declaration
public MyFixedPoint ExternalMass
Field Value
Type |
Description |
VRage.MyFixedPoint |
|
INVENTORY_CHANGED
Declaration
public static MyStringHash INVENTORY_CHANGED
Field Value
SyncType
Declaration
public readonly SyncType SyncType
Field Value
Type |
Description |
VRage.Sync.SyncType |
|
UserData
Declaration
Field Value
Type |
Description |
System.Object |
|
Properties
CargoPercentage
Returns a value in the range [0,1] that indicates how full this inventory is.
0 is empty
1 is full
If there are no cargo constraints, will return empty
Declaration
public float CargoPercentage { get; }
Property Value
Type |
Description |
System.Single |
|
CurrentMass
Declaration
public override MyFixedPoint CurrentMass { get; }
Property Value
Type |
Description |
VRage.MyFixedPoint |
|
Overrides
CurrentVolume
Declaration
public override MyFixedPoint CurrentVolume { get; }
Property Value
Type |
Description |
VRage.MyFixedPoint |
|
Overrides
ForcedPriority
Declaration
public override Nullable<float> ForcedPriority { get; set; }
Property Value
Type |
Description |
System.Nullable<System.Single> |
|
Overrides
InventoryIdx
Declaration
public byte InventoryIdx { get; }
Property Value
Type |
Description |
System.Byte |
|
IsCharacterOwner
Declaration
public bool IsCharacterOwner { get; }
Property Value
Type |
Description |
System.Boolean |
|
IsConstrained
Declaration
public bool IsConstrained { get; }
Property Value
Type |
Description |
System.Boolean |
|
IsFull
Declaration
public bool IsFull { get; }
Property Value
Type |
Description |
System.Boolean |
|
ItemCount
Declaration
public int ItemCount { get; }
Property Value
Type |
Description |
System.Int32 |
|
MaxItemCount
Declaration
public override int MaxItemCount { get; }
Property Value
Type |
Description |
System.Int32 |
|
Overrides
MaxMass
Declaration
public override MyFixedPoint MaxMass { get; }
Property Value
Type |
Description |
VRage.MyFixedPoint |
|
Overrides
MaxVolume
Declaration
public override MyFixedPoint MaxVolume { get; set; }
Property Value
Type |
Description |
VRage.MyFixedPoint |
|
Overrides
Owner
Declaration
public MyEntity Owner { get; }
Property Value
VolumeFillFactor
Declaration
public float VolumeFillFactor { get; }
Property Value
Type |
Description |
System.Single |
|
Methods
Add(IMyInventoryItem, MyFixedPoint)
Declaration
public override bool Add(IMyInventoryItem item, MyFixedPoint amount)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Overrides
AddBlocks(MyCubeBlockDefinition, MyFixedPoint)
Declaration
public bool AddBlocks(MyCubeBlockDefinition blockDef, MyFixedPoint amount)
Parameters
Returns
Type |
Description |
System.Boolean |
|
AddItemClient(Int32, MyPhysicalInventoryItem)
Declaration
public void AddItemClient(int position, MyPhysicalInventoryItem item)
Parameters
AddItems(MyFixedPoint, MyObjectBuilder_Base)
Declaration
public override bool AddItems(MyFixedPoint amount, MyObjectBuilder_Base objectBuilder)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Overrides
ApplyChanges(List<MyComponentChange>)
Declaration
public override void ApplyChanges(List<MyComponentChange> changes)
Parameters
Overrides
CanItemsBeAdded(MyFixedPoint, MyDefinitionId)
Declaration
public bool CanItemsBeAdded(MyFixedPoint amount, MyDefinitionId contentId)
Parameters
Type |
Name |
Description |
VRage.MyFixedPoint |
amount |
|
MyDefinitionId |
contentId |
|
Returns
Type |
Description |
System.Boolean |
|
CanItemsBeAdded(MyFixedPoint, MyDefinitionId, MyFixedPoint, MyFixedPoint, MyFixedPoint, MyFixedPoint)
Declaration
public bool CanItemsBeAdded(MyFixedPoint amount, MyDefinitionId contentId, MyFixedPoint maxVolume, MyFixedPoint maxMass, MyFixedPoint currentVolume, MyFixedPoint currentMass)
Parameters
Type |
Name |
Description |
VRage.MyFixedPoint |
amount |
|
MyDefinitionId |
contentId |
|
VRage.MyFixedPoint |
maxVolume |
|
VRage.MyFixedPoint |
maxMass |
|
VRage.MyFixedPoint |
currentVolume |
|
VRage.MyFixedPoint |
currentMass |
|
Returns
Type |
Description |
System.Boolean |
|
ChangeItemClient(MyPhysicalInventoryItem, Int32)
Declaration
public void ChangeItemClient(MyPhysicalInventoryItem item, int position)
Parameters
CheckConstraint(MyDefinitionId)
Declaration
public bool CheckConstraint(MyDefinitionId contentId)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Clear(Boolean)
Declaration
public void Clear(bool sync = true)
Parameters
Type |
Name |
Description |
System.Boolean |
sync |
|
ClearItems()
Declaration
ComputeAmountThatFits(MyBlueprintDefinitionBase)
Declaration
public MyFixedPoint ComputeAmountThatFits(MyBlueprintDefinitionBase blueprint)
Parameters
Returns
Type |
Description |
VRage.MyFixedPoint |
|
ComputeAmountThatFits(MyDefinitionId, Single, Single)
Declaration
public override MyFixedPoint ComputeAmountThatFits(MyDefinitionId contentId, float volumeRemoved = 0F, float massRemoved = 0F)
Parameters
Type |
Name |
Description |
MyDefinitionId |
contentId |
|
System.Single |
volumeRemoved |
|
System.Single |
massRemoved |
|
Returns
Type |
Description |
VRage.MyFixedPoint |
|
Overrides
ConsumeItem(MyDefinitionId, MyFixedPoint, Int64)
Declaration
public override void ConsumeItem(MyDefinitionId itemId, MyFixedPoint amount, long consumerEntityId = 0L)
Parameters
Type |
Name |
Description |
MyDefinitionId |
itemId |
|
VRage.MyFixedPoint |
amount |
|
System.Int64 |
consumerEntityId |
|
Overrides
ContainItems(Nullable<MyFixedPoint>, MyDefinitionId, MyItemFlags)
Declaration
public bool ContainItems(Nullable<MyFixedPoint> amount, MyDefinitionId contentId, MyItemFlags flags)
Parameters
Returns
Type |
Description |
System.Boolean |
|
ContainItems(MyFixedPoint, MyObjectBuilder_PhysicalObject)
Declaration
public bool ContainItems(MyFixedPoint amount, MyObjectBuilder_PhysicalObject ob)
Parameters
Returns
Type |
Description |
System.Boolean |
|
CountItems(Dictionary<MyDefinitionId, MyFixedPoint>)
Declaration
public override void CountItems(Dictionary<MyDefinitionId, MyFixedPoint> itemCounts)
Parameters
Type |
Name |
Description |
System.Collections.Generic.Dictionary<MyDefinitionId, VRage.MyFixedPoint> |
itemCounts |
|
Overrides
DebugAddItems(MyFixedPoint, MyObjectBuilder_Base)
Declaration
public void DebugAddItems(MyFixedPoint amount, MyObjectBuilder_Base objectBuilder)
Parameters
Deserialize(MyObjectBuilder_ComponentBase)
Declaration
public override void Deserialize(MyObjectBuilder_ComponentBase builder)
Parameters
Overrides
DropItem(Int32, MyFixedPoint)
Declaration
public void DropItem(int itemIndex, MyFixedPoint amount)
Parameters
Type |
Name |
Description |
System.Int32 |
itemIndex |
|
VRage.MyFixedPoint |
amount |
|
DropItemById(UInt32, MyFixedPoint)
Declaration
public void DropItemById(uint itemId, MyFixedPoint amount)
Parameters
Type |
Name |
Description |
System.UInt32 |
itemId |
|
VRage.MyFixedPoint |
amount |
|
Empty()
Declaration
Returns
Type |
Description |
System.Boolean |
|
FilterItemsUsingConstraint()
Declaration
public bool FilterItemsUsingConstraint()
Returns
Type |
Description |
System.Boolean |
|
FindFreeSlotSpace(MyDefinitionId, IMyInventoryItemAdapter)
Declaration
public MyFixedPoint FindFreeSlotSpace(MyDefinitionId contentId, IMyInventoryItemAdapter adapter)
Parameters
Type |
Name |
Description |
MyDefinitionId |
contentId |
|
Sandbox.Game.Entities.Interfaces.IMyInventoryItemAdapter |
adapter |
|
Returns
Type |
Description |
VRage.MyFixedPoint |
|
FindItem(Func<MyPhysicalInventoryItem, Boolean>)
Declaration
public Nullable<MyPhysicalInventoryItem> FindItem(Func<MyPhysicalInventoryItem, bool> predicate)
Parameters
Returns
FindItem(MyDefinitionId)
Declaration
public Nullable<MyPhysicalInventoryItem> FindItem(MyDefinitionId contentId)
Parameters
Returns
FindUsableItem(MyDefinitionId)
This will try to find the first item that can be use. This means, if durability is enabled on items, it will look for first item with durability HP > 0,
if this is disabled, this will behave the same as FindItem method
Declaration
public Nullable<MyPhysicalInventoryItem> FindUsableItem(MyDefinitionId contentId)
Parameters
Type |
Name |
Description |
MyDefinitionId |
contentId |
definition id of the item
|
Returns
FixInventoryVolume(Single)
Declaration
public void FixInventoryVolume(float newValue)
Parameters
Type |
Name |
Description |
System.Single |
newValue |
|
GenerateContent(MyContainerTypeDefinition)
Declaration
public void GenerateContent(MyContainerTypeDefinition containerDefinition)
Parameters
GetFlags()
Declaration
public MyInventoryFlags GetFlags()
Returns
GetInventoryCount()
Returns number of embedded inventories - this inventory can be aggregation of other inventories.
Declaration
public override int GetInventoryCount()
Returns
Type |
Description |
System.Int32 |
Return one for simple inventory, different number when this instance is an aggregation.
|
Overrides
GetItemAmount(MyDefinitionId, MyItemFlags, Boolean)
Declaration
public override MyFixedPoint GetItemAmount(MyDefinitionId contentId, MyItemFlags flags, bool substitute = false)
Parameters
Returns
Type |
Description |
VRage.MyFixedPoint |
|
Overrides
GetItemAt(Int32)
Declaration
public Nullable<MyInventoryItem> GetItemAt(int index)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Returns
GetItemByID(UInt32)
Declaration
public Nullable<MyPhysicalInventoryItem> GetItemByID(uint id)
Parameters
Type |
Name |
Description |
System.UInt32 |
id |
|
Returns
GetItemByIndex(Int32)
Declaration
public Nullable<MyPhysicalInventoryItem> GetItemByIndex(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
GetItemIndexById(UInt32)
Declaration
public int GetItemIndexById(uint id)
Parameters
Type |
Name |
Description |
System.UInt32 |
id |
|
Returns
Type |
Description |
System.Int32 |
|
GetItems()
Declaration
public override List<MyPhysicalInventoryItem> GetItems()
Returns
Overrides
GetItemsCount()
Declaration
public override int GetItemsCount()
Returns
Type |
Description |
System.Int32 |
|
Overrides
GetItemVolumeAndMass(MyDefinitionId, out Single, out Single)
Declaration
public static void GetItemVolumeAndMass(MyDefinitionId contentId, out float itemMass, out float itemVolume)
Parameters
Type |
Name |
Description |
MyDefinitionId |
contentId |
|
System.Single |
itemMass |
|
System.Single |
itemVolume |
|
GetObjectBuilder()
Declaration
public MyObjectBuilder_Inventory GetObjectBuilder()
Returns
Init(MyComponentDefinitionBase)
Declaration
public override void Init(MyComponentDefinitionBase definition)
Parameters
Overrides
Init(MyObjectBuilder_Inventory)
Declaration
public void Init(MyObjectBuilder_Inventory objectBuilder)
Parameters
IsItemAt(Int32)
Declaration
public bool IsItemAt(int position)
Parameters
Type |
Name |
Description |
System.Int32 |
position |
|
Returns
Type |
Description |
System.Boolean |
|
IsUniqueId(UInt32)
Declaration
public bool IsUniqueId(uint idToTest)
Parameters
Type |
Name |
Description |
System.UInt32 |
idToTest |
|
Returns
Type |
Description |
System.Boolean |
|
ItemsCanBeAdded(MyFixedPoint, IMyInventoryItem)
Declaration
public override bool ItemsCanBeAdded(MyFixedPoint amount, IMyInventoryItem item)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Overrides
ItemsCanBeRemoved(MyFixedPoint, IMyInventoryItem)
Declaration
public override bool ItemsCanBeRemoved(MyFixedPoint amount, IMyInventoryItem item)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Overrides
IterateInventory(Int32, Int32)
Search for inventory having given search index.
Aggregate inventory: Iterates through aggregate inventory until simple inventory with matching index is found.
Simple inventory: Returns itself if currentIndex == searchIndex.
Usage: searchIndex = index of inventory being searched, leave currentIndex = 0.
Declaration
public override MyInventoryBase IterateInventory(int searchIndex, int currentIndex = 0)
Parameters
Type |
Name |
Description |
System.Int32 |
searchIndex |
|
System.Int32 |
currentIndex |
|
Returns
Overrides
ModifyContent(MyPhysicalInventoryItem, Action<MyObjectBuilder_PhysicalObject>)
Declaration
public void ModifyContent(MyPhysicalInventoryItem item, Action<MyObjectBuilder_PhysicalObject> action)
Parameters
ModifyDatapad(Int32, UInt32, String, String)
Declaration
[Event(null, 2094)]
[Reliable]
[Server]
public void ModifyDatapad(int inventoryIndex, uint itemId, string name, string data)
Parameters
Type |
Name |
Description |
System.Int32 |
inventoryIndex |
|
System.UInt32 |
itemId |
|
System.String |
name |
|
System.String |
data |
|
OnAddedToContainer()
Declaration
public override void OnAddedToContainer()
Overrides
OnBeforeContentsChanged()
Declaration
public override void OnBeforeContentsChanged()
Overrides
OnContentsAdded(MyPhysicalInventoryItem, MyFixedPoint)
Declaration
public override void OnContentsAdded(MyPhysicalInventoryItem item, MyFixedPoint amount)
Parameters
Overrides
OnContentsChanged()
Declaration
public override void OnContentsChanged()
Overrides
OnContentsRemoved(MyPhysicalInventoryItem, MyFixedPoint)
Declaration
public override void OnContentsRemoved(MyPhysicalInventoryItem item, MyFixedPoint amount)
Parameters
Overrides
PickupItem(MyFloatingObject, MyFixedPoint)
Declaration
public void PickupItem(MyFloatingObject obj, MyFixedPoint amount)
Parameters
Refresh()
Declaration
Remove(IMyInventoryItem, MyFixedPoint)
Declaration
public override bool Remove(IMyInventoryItem item, MyFixedPoint amount)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Overrides
RemoveItemClient(UInt32)
Declaration
public void RemoveItemClient(uint itemId)
Parameters
Type |
Name |
Description |
System.UInt32 |
itemId |
|
RemoveItems(UInt32, Nullable<MyFixedPoint>, Boolean, Boolean, Nullable<MatrixD>, Action<MyDefinitionId, MyEntity>, Boolean)
Declaration
public void RemoveItems(uint itemId, Nullable<MyFixedPoint> amount = null, bool sendEvent = true, bool spawn = false, Nullable<MatrixD> spawnPos = null, Action<MyDefinitionId, MyEntity> itemSpawned = null, bool refreshVolumeAndMass = true)
Parameters
Type |
Name |
Description |
System.UInt32 |
itemId |
|
System.Nullable<VRage.MyFixedPoint> |
amount |
|
System.Boolean |
sendEvent |
|
System.Boolean |
spawn |
|
System.Nullable<MatrixD> |
spawnPos |
|
System.Action<MyDefinitionId, MyEntity> |
itemSpawned |
|
System.Boolean |
refreshVolumeAndMass |
|
RemoveItemsAt(Int32, Nullable<MyFixedPoint>, Boolean, Boolean, Boolean)
Declaration
public void RemoveItemsAt(int itemIndex, Nullable<MyFixedPoint> amount = null, bool sendEvent = true, bool spawn = false, bool refreshVolumeAndMass = true)
Parameters
Type |
Name |
Description |
System.Int32 |
itemIndex |
|
System.Nullable<VRage.MyFixedPoint> |
amount |
|
System.Boolean |
sendEvent |
|
System.Boolean |
spawn |
|
System.Boolean |
refreshVolumeAndMass |
|
RemoveItemsOfType(MyFixedPoint, MyDefinitionId, MyItemFlags, Boolean)
Declaration
public override MyFixedPoint RemoveItemsOfType(MyFixedPoint amount, MyDefinitionId contentId, MyItemFlags flags, bool spawn = false)
Parameters
Returns
Type |
Description |
VRage.MyFixedPoint |
|
Overrides
RemoveItemsOfType(MyFixedPoint, MyObjectBuilder_PhysicalObject, Boolean, Boolean)
Declaration
public bool RemoveItemsOfType(MyFixedPoint amount, MyObjectBuilder_PhysicalObject objectBuilder, bool spawn = false, bool onlyWhole = true)
Parameters
Returns
Type |
Description |
System.Boolean |
|
ResetVolume()
Declaration
public void ResetVolume()
Serialize(Boolean)
Declaration
public override MyObjectBuilder_ComponentBase Serialize(bool copy = false)
Parameters
Type |
Name |
Description |
System.Boolean |
copy |
|
Returns
Overrides
SetFlags(MyInventoryFlags)
Declaration
public void SetFlags(MyInventoryFlags flags)
Parameters
ShowCantConsume()
Declaration
[Event(null, 2405)]
[Reliable]
[Client]
public static void ShowCantConsume()
TakeFloatingBag(MyCargoContainerInventoryBagEntity)
Declaration
public void TakeFloatingBag(MyCargoContainerInventoryBagEntity obj)
Parameters
TakeFloatingObject(MyFloatingObject)
Declaration
public void TakeFloatingObject(MyFloatingObject obj)
Parameters
Transfer(MyInventory, MyInventory, UInt32, Int32, Nullable<MyFixedPoint>, Boolean)
Declaration
public static MyFixedPoint Transfer(MyInventory src, MyInventory dst, uint srcItemId, int dstIdx = -1, Nullable<MyFixedPoint> amount = null, bool spawn = false)
Parameters
Type |
Name |
Description |
MyInventory |
src |
|
MyInventory |
dst |
|
System.UInt32 |
srcItemId |
|
System.Int32 |
dstIdx |
|
System.Nullable<VRage.MyFixedPoint> |
amount |
|
System.Boolean |
spawn |
|
Returns
Type |
Description |
VRage.MyFixedPoint |
|
Transfer(MyInventory, MyInventory, MyDefinitionId, MyItemFlags, Nullable<MyFixedPoint>, Boolean)
Declaration
public static MyFixedPoint Transfer(MyInventory src, MyInventory dst, MyDefinitionId contentId, MyItemFlags flags, Nullable<MyFixedPoint> amount = null, bool spawn = false)
Parameters
Returns
Type |
Description |
VRage.MyFixedPoint |
|
TransferAll(MyInventory, MyInventory)
Declaration
public static void TransferAll(MyInventory src, MyInventory dst)
Parameters
TransferByPlanner(MyInventory, MyInventory, SerializableDefinitionId, MyItemFlags, Nullable<MyFixedPoint>, Boolean)
Declaration
public static void TransferByPlanner(MyInventory src, MyInventory dst, SerializableDefinitionId contentId, MyItemFlags flags, Nullable<MyFixedPoint> amount = null, bool spawn = false)
Parameters
TransferByUser(MyInventory, MyInventory, UInt32, Int32, Nullable<MyFixedPoint>)
Declaration
public static void TransferByUser(MyInventory src, MyInventory dst, uint srcItemId, int dstIdx = -1, Nullable<MyFixedPoint> amount = null)
Parameters
Type |
Name |
Description |
MyInventory |
src |
|
MyInventory |
dst |
|
System.UInt32 |
srcItemId |
|
System.Int32 |
dstIdx |
|
System.Nullable<VRage.MyFixedPoint> |
amount |
|
TransferItemFrom(MyInventory, Int32, Nullable<Int32>, Nullable<Boolean>, Nullable<MyFixedPoint>)
Declaration
public void TransferItemFrom(MyInventory sourceInventory, int sourceItemIndex, Nullable<int> targetItemIndex = null, Nullable<bool> stackIfPossible = null, Nullable<MyFixedPoint> amount = null)
Parameters
Type |
Name |
Description |
MyInventory |
sourceInventory |
|
System.Int32 |
sourceItemIndex |
|
System.Nullable<System.Int32> |
targetItemIndex |
|
System.Nullable<System.Boolean> |
stackIfPossible |
|
System.Nullable<VRage.MyFixedPoint> |
amount |
|
UpdateItem(MyDefinitionId, Nullable<UInt32>, Nullable<Single>, Nullable<Single>)
Declaration
public void UpdateItem(MyDefinitionId contentId, Nullable<uint> itemId = null, Nullable<float> amount = null, Nullable<float> itemHP = null)
Parameters
Type |
Name |
Description |
MyDefinitionId |
contentId |
|
System.Nullable<System.UInt32> |
itemId |
|
System.Nullable<System.Single> |
amount |
|
System.Nullable<System.Single> |
itemHP |
|
UpdateItemAmoutClient(UInt32, MyFixedPoint, Single)
Declaration
public void UpdateItemAmoutClient(uint itemId, MyFixedPoint amount, float gasAmount)
Parameters
Type |
Name |
Description |
System.UInt32 |
itemId |
|
VRage.MyFixedPoint |
amount |
|
System.Single |
gasAmount |
|
Events
OnTransferByUser
Declaration
public static event Action<IMyInventory, IMyInventory, IMyInventoryItem, MyFixedPoint> OnTransferByUser
Event Type
OnVolumeChanged
Declaration
public event Action<IMyInventory, float, float> OnVolumeChanged
Event Type
Type |
Description |
System.Action<IMyInventory, System.Single, System.Single> |
|
Explicit Interface Implementations
IMyInventory.AddItems(MyFixedPoint, MyObjectBuilder_PhysicalObject, Int32)
Declaration
void IMyInventory.AddItems(MyFixedPoint amount, MyObjectBuilder_PhysicalObject objectBuilder, int index)
Parameters
IMyInventory.CanAddItemAmount(IMyInventoryItem, MyFixedPoint)
Declaration
bool IMyInventory.CanAddItemAmount(IMyInventoryItem item, MyFixedPoint amount)
Parameters
Returns
Type |
Description |
System.Boolean |
|
IMyInventory.CanPutItems
Declaration
bool IMyInventory.CanPutItems { get; set; }
Returns
Type |
Description |
System.Boolean |
|
IMyInventory.FindItem(SerializableDefinitionId)
Declaration
IMyInventoryItem IMyInventory.FindItem(SerializableDefinitionId contentId)
Parameters
Returns
IMyInventory.GetItemByID(UInt32)
Declaration
IMyInventoryItem IMyInventory.GetItemByID(uint id)
Parameters
Type |
Name |
Description |
System.UInt32 |
id |
|
Returns
IMyInventory.GetItems()
Declaration
List<IMyInventoryItem> IMyInventory.GetItems()
Returns
IMyInventory.Owner
Declaration
IMyEntity IMyInventory.Owner { get; }
Returns
IMyInventory.RemoveItemAmount(IMyInventoryItem, MyFixedPoint)
Declaration
void IMyInventory.RemoveItemAmount(IMyInventoryItem item, MyFixedPoint amount)
Parameters
IMyInventory.RemoveItems(UInt32, Nullable<MyFixedPoint>, Boolean, Boolean)
Declaration
void IMyInventory.RemoveItems(uint itemId, Nullable<MyFixedPoint> amount, bool sendEvent, bool spawn)
Parameters
Type |
Name |
Description |
System.UInt32 |
itemId |
|
System.Nullable<VRage.MyFixedPoint> |
amount |
|
System.Boolean |
sendEvent |
|
System.Boolean |
spawn |
|
IMyInventory.RemoveItemsAt(Int32, Nullable<MyFixedPoint>, Boolean, Boolean)
Declaration
void IMyInventory.RemoveItemsAt(int itemIndex, Nullable<MyFixedPoint> amount, bool sendEvent, bool spawn)
Parameters
Type |
Name |
Description |
System.Int32 |
itemIndex |
|
System.Nullable<VRage.MyFixedPoint> |
amount |
|
System.Boolean |
sendEvent |
|
System.Boolean |
spawn |
|
IMyInventory.RemoveItemsOfType(MyFixedPoint, MyObjectBuilder_PhysicalObject, Boolean)
Declaration
void IMyInventory.RemoveItemsOfType(MyFixedPoint amount, MyObjectBuilder_PhysicalObject objectBuilder, bool spawn)
Parameters
IMyInventory.RemoveItemsOfType(MyFixedPoint, SerializableDefinitionId, MyItemFlags, Boolean)
Declaration
void IMyInventory.RemoveItemsOfType(MyFixedPoint amount, SerializableDefinitionId contentId, MyItemFlags flags, bool spawn)
Parameters
IMyInventory.TransferItemFrom(IMyInventory, Int32, Nullable<Int32>, Nullable<Boolean>, Nullable<MyFixedPoint>, Boolean)
Declaration
bool IMyInventory.TransferItemFrom(IMyInventory sourceInventory, int sourceItemIndex, Nullable<int> targetItemIndex, Nullable<bool> stackIfPossible, Nullable<MyFixedPoint> amount, bool checkConnection)
Parameters
Type |
Name |
Description |
IMyInventory |
sourceInventory |
|
System.Int32 |
sourceItemIndex |
|
System.Nullable<System.Int32> |
targetItemIndex |
|
System.Nullable<System.Boolean> |
stackIfPossible |
|
System.Nullable<VRage.MyFixedPoint> |
amount |
|
System.Boolean |
checkConnection |
|
Returns
Type |
Description |
System.Boolean |
|
IMyInventory.TransferItemFrom(IMyInventory, IMyInventoryItem, MyFixedPoint)
Declaration
bool IMyInventory.TransferItemFrom(IMyInventory sourceInventory, IMyInventoryItem item, MyFixedPoint amount)
Parameters
Returns
Type |
Description |
System.Boolean |
|
IMyInventory.TransferItemTo(IMyInventory, Int32, Nullable<Int32>, Nullable<Boolean>, Nullable<MyFixedPoint>, Boolean)
Declaration
bool IMyInventory.TransferItemTo(IMyInventory dst, int sourceItemIndex, Nullable<int> targetItemIndex, Nullable<bool> stackIfPossible, Nullable<MyFixedPoint> amount, bool checkConnection)
Parameters
Type |
Name |
Description |
IMyInventory |
dst |
|
System.Int32 |
sourceItemIndex |
|
System.Nullable<System.Int32> |
targetItemIndex |
|
System.Nullable<System.Boolean> |
stackIfPossible |
|
System.Nullable<VRage.MyFixedPoint> |
amount |
|
System.Boolean |
checkConnection |
|
Returns
Type |
Description |
System.Boolean |
|
IMyInventory.CanItemsBeAdded(MyFixedPoint, MyItemType)
Declaration
bool IMyInventory.CanItemsBeAdded(MyFixedPoint amount, MyItemType itemType)
Parameters
Type |
Name |
Description |
VRage.MyFixedPoint |
amount |
|
MyItemType |
itemType |
|
Returns
Type |
Description |
System.Boolean |
|
IMyInventory.CanPutItems
Declaration
bool IMyInventory.CanPutItems { get; }
Returns
Type |
Description |
System.Boolean |
|
IMyInventory.CanTransferItemTo(IMyInventory, MyItemType)
Declaration
bool IMyInventory.CanTransferItemTo(IMyInventory dst, MyItemType itemType)
Parameters
Returns
Type |
Description |
System.Boolean |
|
IMyInventory.ContainItems(MyFixedPoint, MyItemType)
Declaration
bool IMyInventory.ContainItems(MyFixedPoint amount, MyItemType itemType)
Parameters
Type |
Name |
Description |
VRage.MyFixedPoint |
amount |
|
MyItemType |
itemType |
|
Returns
Type |
Description |
System.Boolean |
|
IMyInventory.FindItem(MyItemType)
Declaration
Nullable<MyInventoryItem> IMyInventory.FindItem(MyItemType itemType)
Parameters
Returns
IMyInventory.GetAcceptedItems(List<MyItemType>, Func<MyItemType, Boolean>)
Declaration
void IMyInventory.GetAcceptedItems(List<MyItemType> items, Func<MyItemType, bool> filter)
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<MyItemType> |
items |
|
System.Func<MyItemType, System.Boolean> |
filter |
|
IMyInventory.GetItemAmount(MyItemType)
Declaration
MyFixedPoint IMyInventory.GetItemAmount(MyItemType contentId)
Parameters
Returns
Type |
Description |
VRage.MyFixedPoint |
|
IMyInventory.GetItemByID(UInt32)
Declaration
Nullable<MyInventoryItem> IMyInventory.GetItemByID(uint id)
Parameters
Type |
Name |
Description |
System.UInt32 |
id |
|
Returns
IMyInventory.GetItems(List<MyInventoryItem>, Func<MyInventoryItem, Boolean>)
Declaration
void IMyInventory.GetItems(List<MyInventoryItem> items, Func<MyInventoryItem, bool> filter)
Parameters
IMyInventory.IsConnectedTo(IMyInventory)
Declaration
bool IMyInventory.IsConnectedTo(IMyInventory dst)
Parameters
Returns
Type |
Description |
System.Boolean |
|
IMyInventory.Owner
Declaration
IMyEntity IMyInventory.Owner { get; }
Returns
IMyInventory.TransferItemFrom(IMyInventory, Int32, Nullable<Int32>, Nullable<Boolean>, Nullable<MyFixedPoint>)
Declaration
bool IMyInventory.TransferItemFrom(IMyInventory sourceInventory, int sourceItemIndex, Nullable<int> targetItemIndex, Nullable<bool> stackIfPossible, Nullable<MyFixedPoint> amount)
Parameters
Type |
Name |
Description |
IMyInventory |
sourceInventory |
|
System.Int32 |
sourceItemIndex |
|
System.Nullable<System.Int32> |
targetItemIndex |
|
System.Nullable<System.Boolean> |
stackIfPossible |
|
System.Nullable<VRage.MyFixedPoint> |
amount |
|
Returns
Type |
Description |
System.Boolean |
|
IMyInventory.TransferItemFrom(IMyInventory, MyInventoryItem, Nullable<MyFixedPoint>)
Declaration
bool IMyInventory.TransferItemFrom(IMyInventory sourceInventory, MyInventoryItem item, Nullable<MyFixedPoint> amount)
Parameters
Returns
Type |
Description |
System.Boolean |
|
IMyInventory.TransferItemTo(IMyInventory, Int32, Nullable<Int32>, Nullable<Boolean>, Nullable<MyFixedPoint>)
Declaration
bool IMyInventory.TransferItemTo(IMyInventory dst, int sourceItemIndex, Nullable<int> targetItemIndex, Nullable<bool> stackIfPossible, Nullable<MyFixedPoint> amount)
Parameters
Type |
Name |
Description |
IMyInventory |
dst |
|
System.Int32 |
sourceItemIndex |
|
System.Nullable<System.Int32> |
targetItemIndex |
|
System.Nullable<System.Boolean> |
stackIfPossible |
|
System.Nullable<VRage.MyFixedPoint> |
amount |
|
Returns
Type |
Description |
System.Boolean |
|
IMyInventory.TransferItemTo(IMyInventory, MyInventoryItem, Nullable<MyFixedPoint>)
Declaration
bool IMyInventory.TransferItemTo(IMyInventory dstInventory, MyInventoryItem item, Nullable<MyFixedPoint> amount)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Implements
Extension Methods