Adventure Kit  4.16
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
AAdvKitInventoryManager Class Reference

Inventory manager to hold all items a character carries. More...

#include <AdvKitInventoryManager.h>

Inheritance diagram for AAdvKitInventoryManager:

Public Member Functions

 AAdvKitInventoryManager (const FObjectInitializer &ObjectInitializer)
 
virtual void PostInitializeComponents () override
 
virtual void EndPlay (EEndPlayReason::Type Reason) override
 
virtual void Tick (float DeltaSeconds) override
 
AAdvKitInventoryItemGetPendingInventory () const
 
AAdvKitInventoryItemGetCurrentInventory () const
 
void AddInventory (AAdvKitInventoryItem *NewInventory, bool bEquip=false)
 
virtual void AddInventory_Implementation (AAdvKitInventoryItem *NewInventory, bool bEquip=false)
 
void RemoveInventory (AAdvKitInventoryItem *RemovedInventory)
 
virtual void RemoveInventory_Implementation (AAdvKitInventoryItem *RemovedInventory)
 
virtual AAdvKitInventoryItemGetInventoryByClass (TSubclassOf< AAdvKitInventoryItem > InventoryClass)
 
virtual AAdvKitInventoryItemNextItem ()
 
virtual AAdvKitInventoryItemPreviousItem ()
 
bool CanEquipInventory (AAdvKitInventoryItem *NewInventory, bool bInstant=false)
 
virtual bool CanEquipInventory_Implementation (AAdvKitInventoryItem *NewInventory, bool bInstant=false)
 
virtual void SetNewInventory (AAdvKitInventoryItem *NewInventory, bool bInstant=false)
 
virtual void SetNewInventoryByClass (TSubclassOf< AAdvKitInventoryItem > NewInventoryClass, bool bInstant=false)
 
void SetNewInventoryServer (AAdvKitInventoryItem *NewInventory, bool bInstant=false)
 
virtual void SetNewInventoryServer_Implementation (AAdvKitInventoryItem *NewInventory, bool bInstant=false)
 
virtual void OwnerDied ()
 

Public Attributes

FItemAddedSignature OnItemAdded_DEPRECATED
 
FItemRemovedSignature OnItemRemoved_DEPRECATED
 
FActiveItemChanged OnActiveItemChanged
 
FInventoryItemsChanged OnInventoryItemsChanged
 

Protected Member Functions

virtual void OnRep_InventoryArray ()
 

Protected Attributes

TArray< AAdvKitInventoryItem * > Inventory
 
AAdvKitInventoryItemPendingInventory
 
AAdvKitInventoryItemCurrentInventory
 

Detailed Description

Inventory manager to hold all items a character carries.

Constructor & Destructor Documentation

AAdvKitInventoryManager::AAdvKitInventoryManager ( const FObjectInitializer &  ObjectInitializer)

Constructor

Member Function Documentation

void AAdvKitInventoryManager::AddInventory ( AAdvKitInventoryItem NewInventory,
bool  bEquip = false 
)

Add a new item to the inventory e.g. when the character picks up a weapon.

Parameters
NewInventoryNew item to add
bEquipWhether or not to equip the new item
bool AAdvKitInventoryManager::CanEquipInventory ( AAdvKitInventoryItem NewInventory,
bool  bInstant = false 
)

Check to see if an item can be equipped

Parameters
NewInventoryThe item to equip
bInstantFalse to play un-/equip animation, true to equip without delay
Returns
True if it can be equipped, false otherwise
AAdvKitInventoryItem * AAdvKitInventoryManager::GetCurrentInventory ( ) const

Getter for the currently equipped item.

Returns
Current item
AAdvKitInventoryItem * AAdvKitInventoryManager::GetInventoryByClass ( TSubclassOf< AAdvKitInventoryItem InventoryClass)
virtual

Get the first inventory item that is of the given class.

Parameters
InventoryClassClass of item to find
Returns
Item that matches class
AAdvKitInventoryItem * AAdvKitInventoryManager::GetPendingInventory ( ) const

Getter for the pending inventory item that will be equipped next.

Returns
Pending item
class AAdvKitInventoryItem * AAdvKitInventoryManager::NextItem ( )
virtual

Cycle through the inventory array and equip the next item.

void AAdvKitInventoryManager::OnRep_InventoryArray ( )
protectedvirtual

Callback when the inventory array changed remotely.

void AAdvKitInventoryManager::OwnerDied ( )
virtual

Callback when the owner character of the inventory manager died.

class AAdvKitInventoryItem * AAdvKitInventoryManager::PreviousItem ( )
virtual

Cycle through the inventory array and equip the previous item.

void AAdvKitInventoryManager::RemoveInventory ( AAdvKitInventoryItem RemovedInventory)

Remove an item from the inventory e.g. when the character drops a weapon.

Parameters
RemovedInventoryItem to remove
void AAdvKitInventoryManager::SetNewInventory ( AAdvKitInventoryItem NewInventory,
bool  bInstant = false 
)
virtual

Equip an item

Parameters
NewInventoryThe item to equip
bInstantFalse to play un-/equip animation, true to equip without delay
void AAdvKitInventoryManager::SetNewInventoryByClass ( TSubclassOf< AAdvKitInventoryItem NewInventoryClass,
bool  bInstant = false 
)
virtual

Equip an item that is of the specified class

Parameters
NewInventoryClassThe class of the item to equip
bInstantFalse to play un-/equip animation, true to equip without delay
void AAdvKitInventoryManager::SetNewInventoryServer ( AAdvKitInventoryItem NewInventory,
bool  bInstant = false 
)

Server call to equip an item that is of the specified class

Parameters
NewInventoryThe class of the item to equip
bInstantFalse to play un-/equip animation, true to equip without delay

Member Data Documentation

AAdvKitInventoryItem* AAdvKitInventoryManager::CurrentInventory
protected

Item that is currently equipped

TArray<AAdvKitInventoryItem*> AAdvKitInventoryManager::Inventory
protected

All items currently in the inventory

FActiveItemChanged AAdvKitInventoryManager::OnActiveItemChanged

Delegate that is called when a new item was equipped

FInventoryItemsChanged AAdvKitInventoryManager::OnInventoryItemsChanged

Delegate that is called when a new item was added or removed

FItemAddedSignature AAdvKitInventoryManager::OnItemAdded_DEPRECATED

Delegate that is called when an item was added to the inventory

FItemRemovedSignature AAdvKitInventoryManager::OnItemRemoved_DEPRECATED

Delegate that is called when an item was removed from the inventory

AAdvKitInventoryItem* AAdvKitInventoryManager::PendingInventory
protected

Item the player wants to equip next


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