Inventory Items

Base Item Architecture: CommissarItem.cpp/.h, ACommissarItem

The Item class is derived from AActor and is the parent class for Dynamic Environment Props, Wieldables, Wearables and Consumables. It contains base properties and methods intended to be used universally by all children, like the mesh - friendly name - etc. It also implements empty functions for use, drop, pickup, despite not every item not being able to use those. For items that do not need those methods, they will simply have a boolean used to disable them that is checked in the Character class as described in Character Architecture. Usage: This class should never be Blueprinted, and is only intended for serving as a basis for more specific classes. As such, it is meant to stay as ambiguous as possible and will only implement a few methods. Inheritance diagram

URPOPERTY List

 FString ItemName: edit anywhere, blueprint read only, category: item, usage:  int32 Value: edit anywhere, blueprint read only, category: item, usage:  UStaticMeshComponent* Mesh: edit anywhere, blueprint read-write, category: item, usage:  bool bCanBePickedUp: edit anywhere, blueprint read-write, category: item, usage:  Variables Public Variables

 Private Variables

 Protected Variables

 Methods Public Methods

 ACommissarItem: Constructor.</li> virtual void BeginPlay override: Called when the game begins, or the class instance is spawed.</li> virtual void OnUsed: Called when the player uses an item in view, in the inventory or in their hands.</li> virtual void PickedUp: Removes the mesh component of the item in the world. Called when the item is picked up.</li> virtual void Dropped: Reassigns the mesh component in the world and allows it to drop near the player's location.</li> virtual void Tick(float DeltaSeconds) override: Called every frame. Used for anything that relies on a condition during ticking to be met.</li></ul> Private Methods

</ul> Protected Methods

</ul>