Arma Reforger Script API
Loading...
Searching...
No Matches
Protected Member Functions | List of all members
SCR_VehicleInventoryStorageManagerComponent Interface Reference
Inheritance diagram for SCR_VehicleInventoryStorageManagerComponent:
[legend]

Protected Member Functions

override void FillInitialStorages (out array< BaseInventoryStorageComponent > storagesToAdd)
 Override this method and fill in storagesToAdd array if you have some storages you'd like to register to manager as owned at initialization time.
 
void OnEntityAttached (IEntity ent)
 
override void OnDelete (IEntity owner)
 
- Protected Member Functions inherited from ScriptedInventoryStorageManagerComponent
override void OnItemAdded (BaseInventoryStorageComponent storageOwner, IEntity item)
 Callback when item is added (will be performed locally after server completed the Insert/Move operation)
 
override void OnItemRemoved (BaseInventoryStorageComponent storageOwner, IEntity item)
 Callback when item is removed (will be performed locally after server completed the Remove/Move operation)
 
- Protected Member Functions inherited from InventoryStorageManagerComponent
void OnItemAdded (BaseInventoryStorageComponent storageOwner, IEntity item)
 Callback when item is added (will be performed locally after server completed the Insert/Move operation)
 
void OnItemRemoved (BaseInventoryStorageComponent storageOwner, IEntity item)
 Callback when item is removed (will be performed locally after server completed the Remove/Move operation)
 
void OnStorageAdded (BaseInventoryStorageComponent storage)
 Will be called when new storage is registered at manager.
 
void OnStorageRemoved (BaseInventoryStorageComponent storage)
 Will be called when storage is unregistered from manager.
 
void FillInitialStorages (out array< BaseInventoryStorageComponent > storagesToAdd)
 Override this method and fill in storagesToAdd array if you have some storages you'd like to register to manager as owned at initialization time.
 
void FillInitialPrefabsToStore (out array< ResourceName > prefabsToSpawn)
 Override this method and fill in prefabsToSpawn array if you have some items you'd like to store in inventory at initialization time.
 
bool ShouldForbidRemoveByInstigator (InventoryStorageManagerComponent instigatorManager, BaseInventoryStorageComponent fromStorage, IEntity item)
 Virtual method that allows verification of item removal as a result of move operation on inventory level.
 

Additional Inherited Members

- Public Member Functions inherited from InventoryStorageManagerComponent
proto external IEntity GetOwner ()
 
proto external void AddStorage (BaseInventoryStorageComponent storage)
 
proto external bool CanInsertItem (IEntity item, EStoragePurpose purpose=EStoragePurpose.PURPOSE_ANY)
 Will iterate over storages and find if item can be inserted in first best match.
 
proto external bool CanInsertItemInStorage (IEntity item, BaseInventoryStorageComponent storage, int slotID=-1)
 
proto external bool CanInsertResource (ResourceName resourceName, EStoragePurpose purpose=EStoragePurpose.PURPOSE_ANY, int count=1)
 Will iterate over storages and find if item can be inserted in first best match.
 
proto external bool CanInsertResourceInStorage (ResourceName resourceName, BaseInventoryStorageComponent storage, int slotID=-1, int count=1)
 
proto external bool TryInsertItem (IEntity item, EStoragePurpose purpose=EStoragePurpose.PURPOSE_ANY, InventoryOperationCallback cb=null)
 Will iterate over storages and try insert the item at first best match.
 
proto external bool TryInsertItemInStorage (IEntity item, BaseInventoryStorageComponent storage, int slotID=-1, InventoryOperationCallback cb=null)
 Will try to insert item at storage. If slotID -1 will try to insert in any free storage.
 
proto external bool CanReplaceItem (IEntity item, BaseInventoryStorageComponent storage, int slotID)
 Same as insert, only should allow replacing item at storage slot, slotID is required.
 
proto external bool TryReplaceItem (IEntity item, BaseInventoryStorageComponent storage, int slotID, InventoryOperationCallback cb=null)
 
proto external bool CanRemoveItemFromStorage (IEntity item, BaseInventoryStorageComponent storage)
 
proto external bool TryRemoveItemFromStorage (IEntity item, BaseInventoryStorageComponent storage, InventoryOperationCallback cb=null)
 Will try to remove item from storage.
 
proto external bool CanMoveItemToStorage (IEntity item, BaseInventoryStorageComponent to, int slotID=-1)
 
proto external bool TryMoveItemToStorage (IEntity item, BaseInventoryStorageComponent to, int slotID=-1, InventoryOperationCallback cb=null)
 Will try to move item from source storage to target storage.
 
proto external bool CanSwapItemStorages (IEntity itemA, IEntity itemB)
 
proto external bool TrySwapItemStorages (IEntity itemA, IEntity itemB, InventoryOperationCallback cb=null)
 Will try to place itemA to itemB storage slot and itemB to itemA storage slot.
 
proto external bool TryDeleteItem (IEntity item, InventoryOperationCallback cb=null)
 
proto external bool TrySpawnPrefabToStorage (ResourceName prefab, BaseInventoryStorageComponent storage=null, int slotID=-1, EStoragePurpose purpose=EStoragePurpose.PURPOSE_ANY, InventoryOperationCallback cb=null, int count=1)
 Spawn and insert into inventory if provided storage is null then most suitable storage would be chosen from owned storages.
 
proto external bool ValidateStorageRequest (IEntity storageOwner)
 Validate that the storage is near the player to eliminate potentual message tampering.
 
proto external int GetStorages (out notnull array< BaseInventoryStorageComponent > outStorages, EStoragePurpose purpose=EStoragePurpose.PURPOSE_ANY)
 Get all managed storages.
 
proto external int GetItems (out notnull array< IEntity > outItems)
 Get all items from all managed storages.
 
proto external bool Contains (IEntity item)
 Returns true if item is in the storage, false otherwise.
 
proto external BaseInventoryStorageComponent FindStorageForItem (IEntity item, EStoragePurpose purpose=EStoragePurpose.PURPOSE_ANY)
 Will try to find suitable storage for item.
 
proto external BaseInventoryStorageComponent FindStorageForResource (ResourceName resourceName, EStoragePurpose purpose=EStoragePurpose.PURPOSE_ANY)
 Will try to find suitable storage for resource.
 
proto external BaseInventoryStorageComponent FindStorageForInsert (IEntity item, BaseInventoryStorageComponent fromStorage, EStoragePurpose purpose=EStoragePurpose.PURPOSE_ANY)
 returns first storage with empty space from provided storage hierarchy for provided item and provided storage purpose
 
proto external BaseInventoryStorageComponent FindStorageForResourceInsert (ResourceName resourceName, BaseInventoryStorageComponent fromStorage, EStoragePurpose purpose=EStoragePurpose.PURPOSE_ANY)
 returns first storage with empty space from provided storage hierarchy for provided resource and provided storage purpose
 
proto external int GetDepositItemCountByEntity (IEntity verifier, IEntity entity)
 Fast access to item count in inventory (returns only items that are stored in DEPOSIT storages)
 
proto external int GetDepositItemCountByResource (IEntity verifier, ResourceName resourceName)
 Fast access to item count in inventory (returns only items that are stored in DEPOSIT storages)
 
proto external IEntity FindItem (InventorySearchPredicate predicate, EStoragePurpose purpose=EStoragePurpose.PURPOSE_DEPOSIT)
 Find Item by providing InventorySearchPredicate object.
 
proto external int FindItems (out notnull array< IEntity > foundItems, InventorySearchPredicate predicate, EStoragePurpose purpose=EStoragePurpose.PURPOSE_DEPOSIT)
 
proto external IEntity FindItemWithComponents (array< TypeName > componentsQuery, EStoragePurpose purpose=EStoragePurpose.PURPOSE_DEPOSIT)
 Find Item by specifying necessary component types (eg returns first Entity that contains all of the provided components) IEntity FindGrenadeInDeposit() { array<typename> components = {}; components.Insert(WeaponComponent); components.Insert(GrenadeMoveComponent); IEntity grenade = inventoryStorageManagerComponent.FindItemWithComponents(components, EStoragePurpose.PURPOSE_DEPOSIT); Print(grenade); return grenade; }.
 
proto external int FindItemsWithComponents (out notnull array< IEntity > foundItems, array< TypeName > componentsQuery, EStoragePurpose purpose=EStoragePurpose.PURPOSE_DEPOSIT)
 Find Items by specifying necessary component types (eg all Entities that contain all of the provided components), returns count of found items.
 
proto external int CountItem (InventorySearchPredicate predicate, EStoragePurpose purpose=EStoragePurpose.PURPOSE_DEPOSIT)
 
proto external int GetMagazineCountByWeapon (BaseWeaponComponent weapon)
 Find Items by specifying necessary component types (eg all Entities that contain all of the provided components), returns count of found items.
 
proto external int GetMagazineCountByMuzzle (IEntity verifier, BaseMuzzleComponent pMuzzle)
 Find Items by specifying necessary component types (eg all Entities that contain all of the provided components), returns count of found items.
 
proto external int GetGrenadesCount ()
 
void OnDelete (IEntity owner)
 
- Public Member Functions inherited from GameComponent
bool OnTicksOnRemoteProxy ()
 
- Public Attributes inherited from ScriptedInventoryStorageManagerComponent
ref ScriptInvokerBase< ScriptInvokerEntityAndStorageMethod > m_OnItemAddedInvoker = new ScriptInvokerBase<ScriptInvokerEntityAndStorageMethod>()
 
ref ScriptInvokerBase< ScriptInvokerEntityAndStorageMethod > m_OnItemRemovedInvoker = new ScriptInvokerBase<ScriptInvokerEntityAndStorageMethod>()
 

Member Function Documentation

◆ FillInitialStorages()

override void SCR_VehicleInventoryStorageManagerComponent.FillInitialStorages ( out array< BaseInventoryStorageComponent storagesToAdd)
protected

Override this method and fill in storagesToAdd array if you have some storages you'd like to register to manager as owned at initialization time.

Implements InventoryStorageManagerComponent.

◆ OnDelete()

override void SCR_VehicleInventoryStorageManagerComponent.OnDelete ( IEntity  owner)
protected

◆ OnEntityAttached()

void SCR_VehicleInventoryStorageManagerComponent.OnEntityAttached ( IEntity  ent)
protected

The documentation for this interface was generated from the following file: