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

Public Member Functions

bool IsPrefabInArsenalStorage (ResourceName item)
 Check if given prefab is in the arsenal storage.
 
bool IsItemInArsenalStorage (notnull IEntity item)
 Check if given item is in the arsenal storage.
 
void ~SCR_ArsenalInventoryStorageManagerComponent ()
 
- 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 ()
 

Protected Member Functions

void OnArsenalUpdated (array< ResourceName > newArsenalContent)
 
override void OnItemAdded (BaseInventoryStorageComponent storageOwner, IEntity item)
 Callback when item is added (will be performed locally after server completed the Insert/Move operation)
 
void OnItemsAddedDelay (BaseInventoryStorageComponent storageOwner)
 
override void OnItemRemoved (BaseInventoryStorageComponent storageOwner, IEntity item)
 Callback when item is removed (will be performed locally after server completed the Remove/Move operation)
 
override 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.
 
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.
 

Protected Attributes

bool m_bNegateItemWeightAndVolume
 
float m_fTotalItemWeight
 
bool m_bItemAddCallQuequeCalled
 
ref set< ResourceName > m_ItemsInArsenal = new set<ResourceName>()
 

Additional Inherited Members

- Public Attributes inherited from ScriptedInventoryStorageManagerComponent
ref ScriptInvokerBase< ScriptInvokerEntityAndStorageMethod > m_OnItemAddedInvoker = new ScriptInvokerBase<ScriptInvokerEntityAndStorageMethod>()
 
ref ScriptInvokerBase< ScriptInvokerEntityAndStorageMethod > m_OnItemRemovedInvoker = new ScriptInvokerBase<ScriptInvokerEntityAndStorageMethod>()
 

Constructor & Destructor Documentation

◆ ~SCR_ArsenalInventoryStorageManagerComponent()

void SCR_ArsenalInventoryStorageManagerComponent.~SCR_ArsenalInventoryStorageManagerComponent ( )

Member Function Documentation

◆ FillInitialPrefabsToStore()

override void SCR_ArsenalInventoryStorageManagerComponent.FillInitialPrefabsToStore ( out array< ResourceName >  prefabsToSpawn)
protected

Override this method and fill in prefabsToSpawn array if you have some items you'd like to store in inventory at initialization time.

Implements InventoryStorageManagerComponent.

◆ IsItemInArsenalStorage()

bool SCR_ArsenalInventoryStorageManagerComponent.IsItemInArsenalStorage ( notnull IEntity  item)

Check if given item is in the arsenal storage.

(Prefabs only)

Parameters
[in]itemItem to check if it is in the arsenal storage
Returns
True if item found, else returns false

◆ IsPrefabInArsenalStorage()

bool SCR_ArsenalInventoryStorageManagerComponent.IsPrefabInArsenalStorage ( ResourceName  item)

Check if given prefab is in the arsenal storage.

Parameters
[in]itemPrefab to check if it is in the arsenal storage
Returns
True if prefab found, else returns false

◆ OnArsenalUpdated()

void SCR_ArsenalInventoryStorageManagerComponent.OnArsenalUpdated ( array< ResourceName >  newArsenalContent)
protected

◆ OnItemAdded()

override void SCR_ArsenalInventoryStorageManagerComponent.OnItemAdded ( BaseInventoryStorageComponent  storageOwner,
IEntity  item 
)
protected

Callback when item is added (will be performed locally after server completed the Insert/Move operation)

Implements ScriptedInventoryStorageManagerComponent.

◆ OnItemRemoved()

override void SCR_ArsenalInventoryStorageManagerComponent.OnItemRemoved ( BaseInventoryStorageComponent  storageOwner,
IEntity  item 
)
protected

Callback when item is removed (will be performed locally after server completed the Remove/Move operation)

Implements ScriptedInventoryStorageManagerComponent.

◆ OnItemsAddedDelay()

void SCR_ArsenalInventoryStorageManagerComponent.OnItemsAddedDelay ( BaseInventoryStorageComponent  storageOwner)
protected

Member Data Documentation

◆ m_bItemAddCallQuequeCalled

bool SCR_ArsenalInventoryStorageManagerComponent.m_bItemAddCallQuequeCalled
protected

◆ m_bNegateItemWeightAndVolume

bool SCR_ArsenalInventoryStorageManagerComponent.m_bNegateItemWeightAndVolume
protected

◆ m_fTotalItemWeight

float SCR_ArsenalInventoryStorageManagerComponent.m_fTotalItemWeight
protected

◆ m_ItemsInArsenal

ref set<ResourceName> SCR_ArsenalInventoryStorageManagerComponent.m_ItemsInArsenal = new set<ResourceName>()
protected

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