ALimenTool
Overview
ALimenTool is a subclass of ALimenPhysicalItem designed to represent interactive tools within the game world. It manages an ability component and handles the logic for activating and deactivating the tool. The class includes delegates for tracking tool activation state changes and provides public methods to control the tool's active state.
Properties
Type | Name | Access | Description |
|---|---|---|---|
| OnToolActiveStateChanged | BlueprintAssignable | Delegate that is broadcast when the tool's active state changes. |
| AbilityComponent | EditDefaultsOnly, BlueprintReadOnly | The ability component associated with this tool. |
| bStartActive | EditDefaultsOnly, BlueprintReadOnly | Whether the tool should start in an activated state. |
Functions
Return Type | Signature | Description |
|---|---|---|
| BeginPlay() | Called when the game starts or when spawned. Initializes the tool's active state based on |
| ActivateTool() | Activates the tool if it can be activated. Returns true if successful, false otherwise. |
| DeactivateTool() | Deactivates the tool. |
| ToggleTool() | Toggles the tool's active state between activated and deactivated. Returns the new active state. |
| CanActivate() const | Determines whether the tool can be activated. Returns true if not already active, false otherwise. |
| IsActive() const | Checks if the tool is currently active. Returns true if active, false otherwise. |
| ToolActivated() | Called when the tool is activated. Can be overridden to implement specific logic for activation. |
| ToolDeactivated() | Called when the tool is deactivated. Can be overridden to implement specific logic for deactivation. |
Usage & Implementation Notes
The tool's active state is managed by the
bIsActiveproperty, which is toggled by public methods.The
ToolActivated()andToolDeactivated()methods are virtual and can be overridden in derived classes to provide custom behavior when the tool is activated or deactivated.The
OnToolActiveStateChangeddelegate is broadcast whenever the tool's active state changes.