Space Engineers
|
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< MyPhysicalInventoryItem > | GetItems () |
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< MyInventoryBase > | ContentsChanged |
Called when items were added or removed, or their amount has changed More... | |
Action< MyInventoryBase > | BeforeContentsChanged |
Action< MyInventoryBase, MyComponentContainer > | OwnerChanged |
Called if this inventory changed its owner More... | |
Events inherited from VRage.Game.Components.MyEntityComponentBase | |
static Action< MyEntityComponentBase > | OnAfterAddedToContainer |
Action< MyEntityComponentBase > | BeforeRemovedFromContainer |
Definition at line 62 of file MyInventory.cs.
|
inline |
Definition at line 130 of file MyInventory.cs.
|
inline |
Definition at line 135 of file MyInventory.cs.
|
inline |
Definition at line 140 of file MyInventory.cs.
|
inline |
Definition at line 145 of file MyInventory.cs.
|
inline |
Definition at line 170 of file MyInventory.cs.
|
inlinevirtual |
Implements VRage.Game.Entity.MyInventoryBase.
Definition at line 1932 of file MyInventory.cs.
|
inline |
Definition at line 592 of file MyInventory.cs.
|
inline |
Definition at line 623 of file MyInventory.cs.
|
inline |
Definition at line 1803 of file MyInventory.cs.
|
inline |
Definition at line 553 of file MyInventory.cs.
|
inline |
Definition at line 1555 of file MyInventory.cs.
|
inlinevirtual |
Adds item to inventory
amount | |
objectBuilder | |
index |
Implements VRage.Game.Entity.MyInventoryBase.
Definition at line 705 of file MyInventory.cs.
|
inlinevirtual |
Implements VRage.Game.Entity.MyInventoryBase.
Definition at line 1452 of file MyInventory.cs.
|
inline |
Definition at line 303 of file MyInventory.cs.
|
inlinestatic |
Definition at line 309 of file MyInventory.cs.
|
inline |
Definition at line 377 of file MyInventory.cs.
|
inline |
Implements VRage.Game.ModAPI.IMyInventory.
Definition at line 1196 of file MyInventory.cs.
|
inline |
Definition at line 1549 of file MyInventory.cs.
|
inlinevirtual |
Implements VRage.Game.Entity.MyInventoryBase.
Definition at line 336 of file MyInventory.cs.
|
inline |
Definition at line 363 of file MyInventory.cs.
|
inlinevirtual |
Implements VRage.Game.Entity.MyInventoryBase.
Definition at line 2194 of file MyInventory.cs.
|
inline |
Definition at line 385 of file MyInventory.cs.
|
inline |
Definition at line 526 of file MyInventory.cs.
|
inlinevirtual |
Implements VRage.Game.Entity.MyInventoryBase.
Definition at line 1419 of file MyInventory.cs.
|
inline |
Definition at line 693 of file MyInventory.cs.
|
inlinevirtual |
Reimplemented from VRage.Game.Components.MyComponentBase.
Definition at line 1750 of file MyInventory.cs.
|
inline |
Definition at line 954 of file MyInventory.cs.
|
inline |
Definition at line 949 of file MyInventory.cs.
|
inline |
Implements VRage.Game.ModAPI.IMyInventory.
Definition at line 1083 of file MyInventory.cs.
|
inline |
Definition at line 1396 of file MyInventory.cs.
|
inline |
Definition at line 391 of file MyInventory.cs.
|
inline |
Definition at line 440 of file MyInventory.cs.
|
inline |
Definition at line 449 of file MyInventory.cs.
|
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
contentId | definition id of the item |
Definition at line 466 of file MyInventory.cs.
|
inline |
Definition at line 2343 of file MyInventory.cs.
|
inline |
Definition at line 1712 of file MyInventory.cs.
|
inline |
Definition at line 238 of file MyInventory.cs.
|
inlinevirtual |
Returns number of embedded inventories - this inventory can be aggregation of other inventories.
Implements VRage.Game.Entity.MyInventoryBase.
Definition at line 2204 of file MyInventory.cs.
|
inlinevirtual |
Implements VRage.Game.Entity.MyInventoryBase.
Definition at line 410 of file MyInventory.cs.
|
inline |
Implements VRage.Game.ModAPI.Ingame.IMyInventory.
Definition at line 1224 of file MyInventory.cs.
|
inline |
Definition at line 1962 of file MyInventory.cs.
|
inlinevirtual |
Implements VRage.Game.Entity.MyInventoryBase.
Definition at line 1078 of file MyInventory.cs.
|
inlinevirtual |
Returns the number of items in the inventory. This needs to be overrided, otherwise it returns 0!
Reimplemented from VRage.Game.Entity.MyInventoryBase.
Definition at line 1957 of file MyInventory.cs.
|
inlinestatic |
Definition at line 321 of file MyInventory.cs.
|
inline |
Definition at line 1586 of file MyInventory.cs.
|
inline |
Definition at line 1607 of file MyInventory.cs.
|
inlinevirtual |
Reimplemented from VRage.Game.Components.MyComponentBase.
Definition at line 1696 of file MyInventory.cs.
|
inline |
Implements VRage.Game.ModAPI.Ingame.IMyInventory.
Definition at line 1414 of file MyInventory.cs.
|
inline |
Definition at line 2058 of file MyInventory.cs.
|
inlinevirtual |
Implements VRage.Game.Entity.MyInventoryBase.
Definition at line 1908 of file MyInventory.cs.
|
inlinevirtual |
Implements VRage.Game.Entity.MyInventoryBase.
Definition at line 1916 of file MyInventory.cs.
|
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.
|
inlinevirtual |
Implements VRage.Game.Entity.MyInventoryBase.
Definition at line 2094 of file MyInventory.cs.
|
inlinevirtual |
Implements VRage.Game.Entity.MyInventoryBase.
Definition at line 2085 of file MyInventory.cs.
|
inline |
Definition at line 654 of file MyInventory.cs.
|
inline |
Definition at line 2337 of file MyInventory.cs.
|
inlinevirtual |
Implements VRage.Game.Entity.MyInventoryBase.
Definition at line 1939 of file MyInventory.cs.
|
inline |
Definition at line 2310 of file MyInventory.cs.
|
inline |
Definition at line 985 of file MyInventory.cs.
|
inline |
Definition at line 960 of file MyInventory.cs.
|
inline |
Definition at line 1032 of file MyInventory.cs.
|
inline |
Definition at line 939 of file MyInventory.cs.
|
inlinevirtual |
Remove items of a given amount and definition
amount | amount ot remove |
contentId | definition id of items to be removed |
spawn | Set tru to spawn object in the world, after it was removed |
Implements VRage.Game.Entity.MyInventoryBase.
Definition at line 944 of file MyInventory.cs.
|
inline |
Definition at line 2351 of file MyInventory.cs.
|
inlinevirtual |
Reimplemented from VRage.Game.Components.MyComponentBase.
Definition at line 1745 of file MyInventory.cs.
|
inline |
Definition at line 233 of file MyInventory.cs.
|
inline |
Definition at line 1575 of file MyInventory.cs.
|
inline |
Definition at line 532 of file MyInventory.cs.
|
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.
|
inlinestatic |
Definition at line 1094 of file MyInventory.cs.
|
inlinestatic |
Definition at line 1300 of file MyInventory.cs.
|
inlinestatic |
Definition at line 1284 of file MyInventory.cs.
|
inlinestatic |
Definition at line 1233 of file MyInventory.cs.
|
inline |
Definition at line 1214 of file MyInventory.cs.
|
inlinevirtual |
Transfers safely given item from inventory given as parameter to this instance.
Implements VRage.Game.Entity.MyInventoryBase.
Definition at line 2103 of file MyInventory.cs.
|
inline |
Definition at line 1795 of file MyInventory.cs.
|
inline |
Definition at line 2012 of file MyInventory.cs.
|
inline |
Definition at line 2273 of file MyInventory.cs.
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.
|
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.
|
get |
Definition at line 229 of file MyInventory.cs.
|
get |
Definition at line 215 of file MyInventory.cs.
|
getset |
Definition at line 101 of file MyInventory.cs.
|
get |
Definition at line 257 of file MyInventory.cs.
|
get |
Definition at line 275 of file MyInventory.cs.
|
get |
Definition at line 202 of file MyInventory.cs.
|
get |
Definition at line 182 of file MyInventory.cs.
|
get |
Definition at line 192 of file MyInventory.cs.
|
get |
Definition at line 244 of file MyInventory.cs.
|
get |
Definition at line 220 of file MyInventory.cs.