Space Engineers
Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
Sandbox.Game.MyInventory Class Reference
Inheritance diagram for Sandbox.Game.MyInventory:
VRage.Game.ModAPI.Ingame.IMyInventory VRage.Game.ModAPI.IMyInventory VRage.Game.Entity.MyInventoryBase VRage.Game.ModAPI.Ingame.IMyInventory VRage.Game.Components.MyEntityComponentBase VRage.Network.IMyEventProxy VRage.Game.Components.MyComponentBase VRage.Network.IMyEventOwner

Public Member Functions

 MyInventory ()
 
 MyInventory (float maxVolume, Vector3 size, MyInventoryFlags flags)
 
 MyInventory (float maxVolume, float maxMass, Vector3 size, MyInventoryFlags flags)
 
 MyInventory (MyFixedPoint maxVolume, MyFixedPoint maxMass, Vector3 size, MyInventoryFlags flags)
 
 MyInventory (MyObjectBuilder_InventoryDefinition definition, MyInventoryFlags flags)
 
void SetFlags (MyInventoryFlags flags)
 
MyInventoryFlags GetFlags ()
 
bool CanItemsBeAdded (MyFixedPoint amount, MyDefinitionId contentId)
 
override MyFixedPoint ComputeAmountThatFits (MyDefinitionId contentId, float volumeRemoved=0, float massRemoved=0)
 
MyFixedPoint ComputeAmountThatFits (MyBlueprintDefinitionBase blueprint)
 
bool CheckConstraint (MyDefinitionId contentId)
 
bool ContainItems (MyFixedPoint amount, MyObjectBuilder_PhysicalObject ob)
 
MyFixedPoint FindFreeSlotSpace (MyDefinitionId contentId, IMyInventoryItemAdapter adapter)
 
override MyFixedPoint GetItemAmount (MyDefinitionId contentId, MyItemFlags flags=MyItemFlags.None, bool substitute=false)
 
MyPhysicalInventoryItem FindItem (MyDefinitionId contentId)
 
MyPhysicalInventoryItem FindItem (Func< MyPhysicalInventoryItem, bool > predicate)
 
MyPhysicalInventoryItem FindUsableItem (MyDefinitionId contentId)
 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 More...
 
bool ContainItems (MyFixedPoint?amount, MyDefinitionId contentId, MyItemFlags flags=MyItemFlags.None)
 
void TakeFloatingObject (MyFloatingObject obj)
 
bool AddGrid (MyCubeGrid grid)
 
bool AddBlockAndRemoveFromGrid (MySlimBlock block)
 
bool AddBlocks (MyCubeBlockDefinition blockDef, MyFixedPoint amount)
 
void PickupItem (MyFloatingObject obj, MyFixedPoint amount)
 
void DebugAddItems (MyFixedPoint amount, MyObjectBuilder_Base objectBuilder)
 
override bool AddItems (MyFixedPoint amount, MyObjectBuilder_Base objectBuilder)
 Adds item to inventory More...
 
bool RemoveItemsOfType (MyFixedPoint amount, MyObjectBuilder_PhysicalObject objectBuilder, bool spawn=false)
 
override MyFixedPoint RemoveItemsOfType (MyFixedPoint amount, MyDefinitionId contentId, MyItemFlags flags=MyItemFlags.None, bool spawn=false)
 Remove items of a given amount and definition More...
 
void DropItemById (uint itemId, MyFixedPoint amount)
 
void DropItem (int itemIndex, MyFixedPoint amount)
 
MyEntity RemoveItemsAt (int itemIndex, MyFixedPoint?amount=null, bool sendEvent=true, bool spawn=false, MatrixD?spawnPos=null)
 
MyEntity RemoveItems (uint itemId, MyFixedPoint?amount=null, bool sendEvent=true, bool spawn=false, MatrixD?spawnPos=null)
 
bool RemoveItemsInternal (uint itemId, MyFixedPoint amount, bool sendEvent=true)
 
override List< MyPhysicalInventoryItemGetItems ()
 
bool Empty ()
 
void Clear (bool sync=true)
 
void TransferItemFrom (MyInventory sourceInventory, int sourceItemIndex, int?targetItemIndex=null, bool?stackIfPossible=null, MyFixedPoint?amount=null)
 
MyPhysicalInventoryItem GetItemByID (uint id)
 
bool FilterItemsUsingConstraint ()
 
bool IsItemAt (int position)
 
override void CountItems (Dictionary< MyDefinitionId, MyFixedPoint > itemCounts)
 
override void ApplyChanges (List< MyComponentChange > changes)
 
void ClearItems ()
 
void AddItemClient (int position, MyPhysicalInventoryItem item)
 
void SwapItemClient (int position, int newPosition)
 
MyObjectBuilder_Inventory GetObjectBuilder ()
 
void Init (MyObjectBuilder_Inventory objectBuilder)
 
override void Init (MyComponentDefinitionBase definition)
 
void GenerateContent (MyContainerTypeDefinition containerDefinition)
 
override MyObjectBuilder_ComponentBase Serialize (bool copy=false)
 
override void Deserialize (MyObjectBuilder_ComponentBase builder)
 
void UpdateGasAmount ()
 
void AddEntity (IMyEntity entity, bool blockManipulatedEntity=true)
 
MyEntity TestEntityForPickup (MyEntity entity, Vector3D?hitPosition, out MyDefinitionId entityDefId, bool blockManipulatedEntity=true)
 Returns the entity that should be picked up (doesn't always have to be the provided entity) More...
 
override bool ItemsCanBeAdded (MyFixedPoint amount, IMyInventoryItem item)
 
override bool ItemsCanBeRemoved (MyFixedPoint amount, IMyInventoryItem item)
 
override bool Add (IMyInventoryItem item, MyFixedPoint amount)
 
override bool Remove (IMyInventoryItem item, MyFixedPoint amount)
 
override int GetItemsCount ()
 Returns the number of items in the inventory. This needs to be overrided, otherwise it returns 0! More...
 
int GetItemIndexById (uint id)
 
void UpdateItem (MyDefinitionId contentId, uint?itemId=null, float?amount=null, float?itemHP=null)
 
bool IsUniqueId (uint idToTest)
 
override void OnContentsChanged ()
 
override void OnBeforeContentsChanged ()
 
override bool TransferItemsFrom (MyInventoryBase sourceInventory, IMyInventoryItem item, MyFixedPoint amount)
 Transfers safely given item from inventory given as parameter to this instance. More...
 
override void ConsumeItem (MyDefinitionId itemId, MyFixedPoint amount, long consumerEntityId=0)
 
override int GetInventoryCount ()
 Returns number of embedded inventories - this inventory can be aggregation of other inventories. More...
 
override MyInventoryBase IterateInventory (int searchIndex, int currentIndex=0)
 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. More...
 
void UpdateItemAmoutClient (uint itemId, MyFixedPoint amount)
 
void RemoveItemClient (uint itemId)
 
void Refresh ()
 
void FixInventoryVolume (float newValue)
 
void ResetVolume ()
 
- Public Member Functions inherited from VRage.Game.ModAPI.Ingame.IMyInventory
bool CanItemsBeAdded (VRage.MyFixedPoint amount, SerializableDefinitionId contentId)
 
bool ContainItems (VRage.MyFixedPoint amount, MyObjectBuilder_PhysicalObject ob)
 
bool TransferItemTo (IMyInventory dst, int sourceItemIndex, int?targetItemIndex=null, bool?stackIfPossible=null, VRage.MyFixedPoint?amount=null)
 
bool TransferItemFrom (IMyInventory sourceInventory, int sourceItemIndex, int?targetItemIndex=null, bool?stackIfPossible=null, VRage.MyFixedPoint?amount=null)
 
- Public Member Functions inherited from VRage.Game.ModAPI.IMyInventory
void AddItems (VRage.MyFixedPoint amount, MyObjectBuilder_PhysicalObject objectBuilder, int index=-1)
 
void RemoveItemsOfType (VRage.MyFixedPoint amount, MyObjectBuilder_PhysicalObject objectBuilder, bool spawn=false)
 
void RemoveItemsOfType (VRage.MyFixedPoint amount, SerializableDefinitionId contentId, MyItemFlags flags=MyItemFlags.None, bool spawn=false)
 
void RemoveItemsAt (int itemIndex, VRage.MyFixedPoint?amount=null, bool sendEvent=true, bool spawn=false)
 
void RemoveItems (uint itemId, VRage.MyFixedPoint?amount=null, bool sendEvent=true, bool spawn=false)
 
bool TransferItemTo (VRage.Game.ModAPI.Ingame.IMyInventory dst, int sourceItemIndex, int?targetItemIndex=null, bool?stackIfPossible=null, VRage.MyFixedPoint?amount=null, bool checkConnection=true)
 
bool TransferItemFrom (VRage.Game.ModAPI.Ingame.IMyInventory sourceInventory, int sourceItemIndex, int?targetItemIndex=null, bool?stackIfPossible=null, VRage.MyFixedPoint?amount=null, bool checkConnection=true)
 
- Public Member Functions inherited from VRage.Game.Entity.MyInventoryBase
 MyInventoryBase (string inventoryId)
 
override void Deserialize (MyObjectBuilder_ComponentBase builder)
 
override MyObjectBuilder_ComponentBase Serialize (bool copy=false)
 
override string ToString ()
 
override bool IsSerialized ()
 Tells the component container serializer whether this component should be saved More...
 
void RaiseContentsChanged ()
 
void RaiseBeforeContentsChanged ()
 
- Public Member Functions inherited from VRage.Game.Components.MyEntityComponentBase
override void OnAddedToContainer ()
 Gets called after the container of this component changes More...
 
override void OnBeforeRemovedFromContainer ()
 Gets called before the removal of this component from a container More...
 
- Public Member Functions inherited from VRage.Game.Components.MyComponentBase
virtual void SetContainer (MyComponentContainer container)
 Sets the container of this component. Note that the component is not added to the container here! Therefore, use MyComponentContainer.Add(...) method and it will in turn call this method. Actually, you should seldom have the need to call this method yourself. More...
 
virtual T GetAs< T > ()
 
virtual void OnAddedToScene ()
 CH: TOOD: Be careful! This does not get called if the component is added to a container that is in the scene already! More...
 
virtual void OnRemovedFromScene ()
 CH: TOOD: Be careful! This does not get called if the component is removed from a container that is still in the scene! More...
 

Static Public Member Functions

static bool CanItemsBeAdded (MyFixedPoint amount, MyDefinitionId contentId, MyFixedPoint maxVolume, MyFixedPoint maxMass, MyFixedPoint currentVolume, MyFixedPoint currentMass)
 
static void GetItemVolumeAndMass (MyDefinitionId contentId, out float itemMass, out float itemVolume)
 
static MyFixedPoint Transfer (MyInventory src, MyInventory dst, MyDefinitionId contentId, MyItemFlags flags=MyItemFlags.None, MyFixedPoint?amount=null, bool spawn=false)
 
static void TransferByUser (MyInventory src, MyInventory dst, uint srcItemId, int dstIdx=-1, MyFixedPoint?amount=null)
 
static void TransferAll (MyInventory src, MyInventory dst)
 
static void Transfer (MyInventory src, MyInventory dst, uint srcItemId, int dstIdx=-1, MyFixedPoint?amount=null, bool spawn=false)
 

Public Attributes

object UserData
 Any attached data.. More...
 
readonly SyncType SyncType
 
MyInventoryConstraint Constraint = null
 Constraint filtering items added to inventory. If null, everything is allowed. Note that setting this constraint will not affect items already in the inventory. More...
 
- Public Attributes inherited from VRage.Game.Entity.MyInventoryBase
bool RemoveEntityOnEmpty = false
 Setting this flag to true causes to call Close() on the Entity of Container, when the GetItemsCount() == 0. This causes to remove entity from the world, when this inventory is empty. More...
 

Properties

override float ForcedPriority [get, set]
 
override MyFixedPoint MaxMass [get]
 
override MyFixedPoint MaxVolume [get]
 
override int MaxItemCount [get]
 
override MyFixedPoint CurrentVolume [get]
 
float VolumeFillFactor [get]
 
override MyFixedPoint CurrentMass [get]
 
MyEntity Owner [get]
 
byte InventoryIdx [get]
 
bool IsFull [get]
 
float CargoPercentage [get]
 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 More...
 
- Properties inherited from VRage.Game.ModAPI.Ingame.IMyInventory
bool IsFull [get]
 
VRageMath.Vector3 Size [get]
 
VRage.MyFixedPoint CurrentMass [get]
 
VRage.MyFixedPoint MaxVolume [get]
 
VRage.MyFixedPoint CurrentVolume [get]
 
IMyInventoryOwner Owner [get]
 
- Properties inherited from VRage.Game.Entity.MyInventoryBase
MyStringHash InventoryId [get]
 This is for the purpose of identifying the inventory in aggregates (i.e. "Backpack", "LeftHand", ...) More...
 
abstract MyFixedPoint CurrentMass [get]
 
abstract MyFixedPoint MaxMass [get]
 
abstract int MaxItemCount [get]
 
abstract MyFixedPoint CurrentVolume [get]
 
abstract MyFixedPoint MaxVolume [get]
 
abstract float ForcedPriority [get, set]
 
override string ComponentTypeDebugString [get]
 
- Properties inherited from VRage.Game.Components.MyEntityComponentBase
MyEntityComponentContainer Container [get]
 
IMyEntity Entity [get]
 
abstract string ComponentTypeDebugString [get]
 Name of the base component type for debug purposes (e.g.: "Position") More...
 
- Properties inherited from VRage.Game.Components.MyComponentBase
MyComponentContainer ContainerBase [get]
 This cannot be named Container to not conflict with the definition of Container in MyEntityComponentBase. More...
 

Additional Inherited Members

- Protected Member Functions inherited from VRage.Game.Entity.MyInventoryBase
void OnOwnerChanged ()
 
- Events inherited from VRage.Game.Entity.MyInventoryBase
Action< MyInventoryBaseContentsChanged
 Called when items were added or removed, or their amount has changed More...
 
Action< MyInventoryBaseBeforeContentsChanged
 
Action< MyInventoryBase, MyComponentContainerOwnerChanged
 Called if this inventory changed its owner More...
 
- Events inherited from VRage.Game.Components.MyEntityComponentBase
static Action< MyEntityComponentBaseOnAfterAddedToContainer
 
Action< MyEntityComponentBaseBeforeRemovedFromContainer
 

Detailed Description

Definition at line 62 of file MyInventory.cs.

Constructor & Destructor Documentation

Sandbox.Game.MyInventory.MyInventory ( )
inline

Definition at line 130 of file MyInventory.cs.

Sandbox.Game.MyInventory.MyInventory ( float  maxVolume,
Vector3  size,
MyInventoryFlags  flags 
)
inline

Definition at line 135 of file MyInventory.cs.

Sandbox.Game.MyInventory.MyInventory ( float  maxVolume,
float  maxMass,
Vector3  size,
MyInventoryFlags  flags 
)
inline

Definition at line 140 of file MyInventory.cs.

Sandbox.Game.MyInventory.MyInventory ( MyFixedPoint  maxVolume,
MyFixedPoint  maxMass,
Vector3  size,
MyInventoryFlags  flags 
)
inline

Definition at line 145 of file MyInventory.cs.

Sandbox.Game.MyInventory.MyInventory ( MyObjectBuilder_InventoryDefinition  definition,
MyInventoryFlags  flags 
)
inline

Definition at line 170 of file MyInventory.cs.

Member Function Documentation

override bool Sandbox.Game.MyInventory.Add ( IMyInventoryItem  item,
MyFixedPoint  amount 
)
inlinevirtual

Implements VRage.Game.Entity.MyInventoryBase.

Definition at line 1932 of file MyInventory.cs.

bool Sandbox.Game.MyInventory.AddBlockAndRemoveFromGrid ( MySlimBlock  block)
inline

Definition at line 592 of file MyInventory.cs.

bool Sandbox.Game.MyInventory.AddBlocks ( MyCubeBlockDefinition  blockDef,
MyFixedPoint  amount 
)
inline

Definition at line 623 of file MyInventory.cs.

void Sandbox.Game.MyInventory.AddEntity ( IMyEntity  entity,
bool  blockManipulatedEntity = true 
)
inline

Definition at line 1803 of file MyInventory.cs.

bool Sandbox.Game.MyInventory.AddGrid ( MyCubeGrid  grid)
inline

Definition at line 553 of file MyInventory.cs.

void Sandbox.Game.MyInventory.AddItemClient ( int  position,
MyPhysicalInventoryItem  item 
)
inline

Definition at line 1555 of file MyInventory.cs.

override bool Sandbox.Game.MyInventory.AddItems ( MyFixedPoint  amount,
MyObjectBuilder_Base  objectBuilder 
)
inlinevirtual

Adds item to inventory

Parameters
amount
objectBuilder
index
Returns
true if items were added, false if items didn't fit

Implements VRage.Game.Entity.MyInventoryBase.

Definition at line 705 of file MyInventory.cs.

override void Sandbox.Game.MyInventory.ApplyChanges ( List< MyComponentChange changes)
inlinevirtual

Implements VRage.Game.Entity.MyInventoryBase.

Definition at line 1452 of file MyInventory.cs.

bool Sandbox.Game.MyInventory.CanItemsBeAdded ( MyFixedPoint  amount,
MyDefinitionId  contentId 
)
inline

Definition at line 303 of file MyInventory.cs.

static bool Sandbox.Game.MyInventory.CanItemsBeAdded ( MyFixedPoint  amount,
MyDefinitionId  contentId,
MyFixedPoint  maxVolume,
MyFixedPoint  maxMass,
MyFixedPoint  currentVolume,
MyFixedPoint  currentMass 
)
inlinestatic

Definition at line 309 of file MyInventory.cs.

bool Sandbox.Game.MyInventory.CheckConstraint ( MyDefinitionId  contentId)
inline

Definition at line 377 of file MyInventory.cs.

void Sandbox.Game.MyInventory.Clear ( bool  sync = true)
inline

Implements VRage.Game.ModAPI.IMyInventory.

Definition at line 1196 of file MyInventory.cs.

void Sandbox.Game.MyInventory.ClearItems ( )
inline

Definition at line 1549 of file MyInventory.cs.

override MyFixedPoint Sandbox.Game.MyInventory.ComputeAmountThatFits ( MyDefinitionId  contentId,
float  volumeRemoved = 0,
float  massRemoved = 0 
)
inlinevirtual

Implements VRage.Game.Entity.MyInventoryBase.

Definition at line 336 of file MyInventory.cs.

MyFixedPoint Sandbox.Game.MyInventory.ComputeAmountThatFits ( MyBlueprintDefinitionBase  blueprint)
inline

Definition at line 363 of file MyInventory.cs.

override void Sandbox.Game.MyInventory.ConsumeItem ( MyDefinitionId  itemId,
MyFixedPoint  amount,
long  consumerEntityId = 0 
)
inlinevirtual

Implements VRage.Game.Entity.MyInventoryBase.

Definition at line 2194 of file MyInventory.cs.

bool Sandbox.Game.MyInventory.ContainItems ( MyFixedPoint  amount,
MyObjectBuilder_PhysicalObject  ob 
)
inline

Definition at line 385 of file MyInventory.cs.

bool Sandbox.Game.MyInventory.ContainItems ( MyFixedPoint amount,
MyDefinitionId  contentId,
MyItemFlags  flags = MyItemFlags.None 
)
inline

Definition at line 526 of file MyInventory.cs.

override void Sandbox.Game.MyInventory.CountItems ( Dictionary< MyDefinitionId, MyFixedPoint itemCounts)
inlinevirtual

Implements VRage.Game.Entity.MyInventoryBase.

Definition at line 1419 of file MyInventory.cs.

void Sandbox.Game.MyInventory.DebugAddItems ( MyFixedPoint  amount,
MyObjectBuilder_Base  objectBuilder 
)
inline

Definition at line 693 of file MyInventory.cs.

override void Sandbox.Game.MyInventory.Deserialize ( MyObjectBuilder_ComponentBase  builder)
inlinevirtual

Reimplemented from VRage.Game.Components.MyComponentBase.

Definition at line 1750 of file MyInventory.cs.

void Sandbox.Game.MyInventory.DropItem ( int  itemIndex,
MyFixedPoint  amount 
)
inline

Definition at line 954 of file MyInventory.cs.

void Sandbox.Game.MyInventory.DropItemById ( uint  itemId,
MyFixedPoint  amount 
)
inline

Definition at line 949 of file MyInventory.cs.

bool Sandbox.Game.MyInventory.Empty ( )
inline

Implements VRage.Game.ModAPI.IMyInventory.

Definition at line 1083 of file MyInventory.cs.

bool Sandbox.Game.MyInventory.FilterItemsUsingConstraint ( )
inline

Definition at line 1396 of file MyInventory.cs.

MyFixedPoint Sandbox.Game.MyInventory.FindFreeSlotSpace ( MyDefinitionId  contentId,
IMyInventoryItemAdapter  adapter 
)
inline

Definition at line 391 of file MyInventory.cs.

MyPhysicalInventoryItem Sandbox.Game.MyInventory.FindItem ( MyDefinitionId  contentId)
inline

Definition at line 440 of file MyInventory.cs.

MyPhysicalInventoryItem Sandbox.Game.MyInventory.FindItem ( Func< MyPhysicalInventoryItem, bool >  predicate)
inline

Definition at line 449 of file MyInventory.cs.

MyPhysicalInventoryItem Sandbox.Game.MyInventory.FindUsableItem ( MyDefinitionId  contentId)
inline

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

Parameters
contentIddefinition id of the item
Returns
item that has durability > 0 if found

Definition at line 466 of file MyInventory.cs.

void Sandbox.Game.MyInventory.FixInventoryVolume ( float  newValue)
inline

Definition at line 2343 of file MyInventory.cs.

void Sandbox.Game.MyInventory.GenerateContent ( MyContainerTypeDefinition  containerDefinition)
inline

Definition at line 1712 of file MyInventory.cs.

MyInventoryFlags Sandbox.Game.MyInventory.GetFlags ( )
inline

Definition at line 238 of file MyInventory.cs.

override int Sandbox.Game.MyInventory.GetInventoryCount ( )
inlinevirtual

Returns number of embedded inventories - this inventory can be aggregation of other inventories.

Returns
Return one for simple inventory, different number when this instance is an aggregation.

Implements VRage.Game.Entity.MyInventoryBase.

Definition at line 2204 of file MyInventory.cs.

override MyFixedPoint Sandbox.Game.MyInventory.GetItemAmount ( MyDefinitionId  contentId,
MyItemFlags  flags = MyItemFlags.None,
bool  substitute = false 
)
inlinevirtual

Implements VRage.Game.Entity.MyInventoryBase.

Definition at line 410 of file MyInventory.cs.

MyPhysicalInventoryItem Sandbox.Game.MyInventory.GetItemByID ( uint  id)
inline

Implements VRage.Game.ModAPI.Ingame.IMyInventory.

Definition at line 1224 of file MyInventory.cs.

int Sandbox.Game.MyInventory.GetItemIndexById ( uint  id)
inline

Definition at line 1962 of file MyInventory.cs.

override List<MyPhysicalInventoryItem> Sandbox.Game.MyInventory.GetItems ( )
inlinevirtual

Implements VRage.Game.Entity.MyInventoryBase.

Definition at line 1078 of file MyInventory.cs.

override int Sandbox.Game.MyInventory.GetItemsCount ( )
inlinevirtual

Returns the number of items in the inventory. This needs to be overrided, otherwise it returns 0!

Returns
int - number of items in inventory

Reimplemented from VRage.Game.Entity.MyInventoryBase.

Definition at line 1957 of file MyInventory.cs.

static void Sandbox.Game.MyInventory.GetItemVolumeAndMass ( MyDefinitionId  contentId,
out float  itemMass,
out float  itemVolume 
)
inlinestatic

Definition at line 321 of file MyInventory.cs.

MyObjectBuilder_Inventory Sandbox.Game.MyInventory.GetObjectBuilder ( )
inline

Definition at line 1586 of file MyInventory.cs.

void Sandbox.Game.MyInventory.Init ( MyObjectBuilder_Inventory  objectBuilder)
inline

Definition at line 1607 of file MyInventory.cs.

override void Sandbox.Game.MyInventory.Init ( MyComponentDefinitionBase  definition)
inlinevirtual

Reimplemented from VRage.Game.Components.MyComponentBase.

Definition at line 1696 of file MyInventory.cs.

bool Sandbox.Game.MyInventory.IsItemAt ( int  position)
inline

Implements VRage.Game.ModAPI.Ingame.IMyInventory.

Definition at line 1414 of file MyInventory.cs.

bool Sandbox.Game.MyInventory.IsUniqueId ( uint  idToTest)
inline

Definition at line 2058 of file MyInventory.cs.

override bool Sandbox.Game.MyInventory.ItemsCanBeAdded ( MyFixedPoint  amount,
IMyInventoryItem  item 
)
inlinevirtual

Implements VRage.Game.Entity.MyInventoryBase.

Definition at line 1908 of file MyInventory.cs.

override bool Sandbox.Game.MyInventory.ItemsCanBeRemoved ( MyFixedPoint  amount,
IMyInventoryItem  item 
)
inlinevirtual

Implements VRage.Game.Entity.MyInventoryBase.

Definition at line 1916 of file MyInventory.cs.

override MyInventoryBase Sandbox.Game.MyInventory.IterateInventory ( int  searchIndex,
int  currentIndex = 0 
)
inlinevirtual

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.

Implements VRage.Game.Entity.MyInventoryBase.

Definition at line 2216 of file MyInventory.cs.

override void Sandbox.Game.MyInventory.OnBeforeContentsChanged ( )
inlinevirtual

Implements VRage.Game.Entity.MyInventoryBase.

Definition at line 2094 of file MyInventory.cs.

override void Sandbox.Game.MyInventory.OnContentsChanged ( )
inlinevirtual

Implements VRage.Game.Entity.MyInventoryBase.

Definition at line 2085 of file MyInventory.cs.

void Sandbox.Game.MyInventory.PickupItem ( MyFloatingObject  obj,
MyFixedPoint  amount 
)
inline

Definition at line 654 of file MyInventory.cs.

void Sandbox.Game.MyInventory.Refresh ( )
inline

Definition at line 2337 of file MyInventory.cs.

override bool Sandbox.Game.MyInventory.Remove ( IMyInventoryItem  item,
MyFixedPoint  amount 
)
inlinevirtual

Implements VRage.Game.Entity.MyInventoryBase.

Definition at line 1939 of file MyInventory.cs.

void Sandbox.Game.MyInventory.RemoveItemClient ( uint  itemId)
inline

Definition at line 2310 of file MyInventory.cs.

MyEntity Sandbox.Game.MyInventory.RemoveItems ( uint  itemId,
MyFixedPoint amount = null,
bool  sendEvent = true,
bool  spawn = false,
MatrixD spawnPos = null 
)
inline

Definition at line 985 of file MyInventory.cs.

MyEntity Sandbox.Game.MyInventory.RemoveItemsAt ( int  itemIndex,
MyFixedPoint amount = null,
bool  sendEvent = true,
bool  spawn = false,
MatrixD spawnPos = null 
)
inline

Definition at line 960 of file MyInventory.cs.

bool Sandbox.Game.MyInventory.RemoveItemsInternal ( uint  itemId,
MyFixedPoint  amount,
bool  sendEvent = true 
)
inline

Definition at line 1032 of file MyInventory.cs.

bool Sandbox.Game.MyInventory.RemoveItemsOfType ( MyFixedPoint  amount,
MyObjectBuilder_PhysicalObject  objectBuilder,
bool  spawn = false 
)
inline

Definition at line 939 of file MyInventory.cs.

override MyFixedPoint Sandbox.Game.MyInventory.RemoveItemsOfType ( MyFixedPoint  amount,
MyDefinitionId  contentId,
MyItemFlags  flags = MyItemFlags.None,
bool  spawn = false 
)
inlinevirtual

Remove items of a given amount and definition

Parameters
amountamount ot remove
contentIddefinition id of items to be removed
spawnSet tru to spawn object in the world, after it was removed
Returns
Returns the actually removed amount

Implements VRage.Game.Entity.MyInventoryBase.

Definition at line 944 of file MyInventory.cs.

void Sandbox.Game.MyInventory.ResetVolume ( )
inline

Definition at line 2351 of file MyInventory.cs.

override MyObjectBuilder_ComponentBase Sandbox.Game.MyInventory.Serialize ( bool  copy = false)
inlinevirtual

Reimplemented from VRage.Game.Components.MyComponentBase.

Definition at line 1745 of file MyInventory.cs.

void Sandbox.Game.MyInventory.SetFlags ( MyInventoryFlags  flags)
inline

Definition at line 233 of file MyInventory.cs.

void Sandbox.Game.MyInventory.SwapItemClient ( int  position,
int  newPosition 
)
inline

Definition at line 1575 of file MyInventory.cs.

void Sandbox.Game.MyInventory.TakeFloatingObject ( MyFloatingObject  obj)
inline

Definition at line 532 of file MyInventory.cs.

MyEntity Sandbox.Game.MyInventory.TestEntityForPickup ( MyEntity  entity,
Vector3D hitPosition,
out MyDefinitionId  entityDefId,
bool  blockManipulatedEntity = true 
)
inline

Returns the entity that should be picked up (doesn't always have to be the provided entity)

Definition at line 1859 of file MyInventory.cs.

static MyFixedPoint Sandbox.Game.MyInventory.Transfer ( MyInventory  src,
MyInventory  dst,
MyDefinitionId  contentId,
MyItemFlags  flags = MyItemFlags.None,
MyFixedPoint amount = null,
bool  spawn = false 
)
inlinestatic

Definition at line 1094 of file MyInventory.cs.

static void Sandbox.Game.MyInventory.Transfer ( MyInventory  src,
MyInventory  dst,
uint  srcItemId,
int  dstIdx = -1,
MyFixedPoint amount = null,
bool  spawn = false 
)
inlinestatic

Definition at line 1300 of file MyInventory.cs.

static void Sandbox.Game.MyInventory.TransferAll ( MyInventory  src,
MyInventory  dst 
)
inlinestatic

Definition at line 1284 of file MyInventory.cs.

static void Sandbox.Game.MyInventory.TransferByUser ( MyInventory  src,
MyInventory  dst,
uint  srcItemId,
int  dstIdx = -1,
MyFixedPoint amount = null 
)
inlinestatic

Definition at line 1233 of file MyInventory.cs.

void Sandbox.Game.MyInventory.TransferItemFrom ( MyInventory  sourceInventory,
int  sourceItemIndex,
int?  targetItemIndex = null,
bool?  stackIfPossible = null,
MyFixedPoint amount = null 
)
inline

Definition at line 1214 of file MyInventory.cs.

override bool Sandbox.Game.MyInventory.TransferItemsFrom ( MyInventoryBase  sourceInventory,
IMyInventoryItem  item,
MyFixedPoint  amount 
)
inlinevirtual

Transfers safely given item from inventory given as parameter to this instance.

Returns
true if items were succesfully transfered, otherwise, false

Implements VRage.Game.Entity.MyInventoryBase.

Definition at line 2103 of file MyInventory.cs.

void Sandbox.Game.MyInventory.UpdateGasAmount ( )
inline

Definition at line 1795 of file MyInventory.cs.

void Sandbox.Game.MyInventory.UpdateItem ( MyDefinitionId  contentId,
uint?  itemId = null,
float?  amount = null,
float?  itemHP = null 
)
inline

Definition at line 2012 of file MyInventory.cs.

void Sandbox.Game.MyInventory.UpdateItemAmoutClient ( uint  itemId,
MyFixedPoint  amount 
)
inline

Definition at line 2273 of file MyInventory.cs.

Member Data Documentation

MyInventoryConstraint Sandbox.Game.MyInventory.Constraint = null

Constraint filtering items added to inventory. If null, everything is allowed. Note that setting this constraint will not affect items already in the inventory.

Definition at line 119 of file MyInventory.cs.

readonly SyncType Sandbox.Game.MyInventory.SyncType

Definition at line 111 of file MyInventory.cs.

object Sandbox.Game.MyInventory.UserData

Any attached data..

Definition at line 99 of file MyInventory.cs.

Property Documentation

float Sandbox.Game.MyInventory.CargoPercentage
get

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

Definition at line 286 of file MyInventory.cs.

override MyFixedPoint Sandbox.Game.MyInventory.CurrentMass
get

Definition at line 229 of file MyInventory.cs.

override MyFixedPoint Sandbox.Game.MyInventory.CurrentVolume
get

Definition at line 215 of file MyInventory.cs.

override float Sandbox.Game.MyInventory.ForcedPriority
getset

Definition at line 101 of file MyInventory.cs.

byte Sandbox.Game.MyInventory.InventoryIdx
get

Definition at line 257 of file MyInventory.cs.

bool Sandbox.Game.MyInventory.IsFull
get

Definition at line 275 of file MyInventory.cs.

override int Sandbox.Game.MyInventory.MaxItemCount
get

Definition at line 202 of file MyInventory.cs.

override MyFixedPoint Sandbox.Game.MyInventory.MaxMass
get

Definition at line 182 of file MyInventory.cs.

override MyFixedPoint Sandbox.Game.MyInventory.MaxVolume
get

Definition at line 192 of file MyInventory.cs.

MyEntity Sandbox.Game.MyInventory.Owner
get

Definition at line 244 of file MyInventory.cs.

float Sandbox.Game.MyInventory.VolumeFillFactor
get

Definition at line 220 of file MyInventory.cs.


The documentation for this class was generated from the following files: