Oakfolks Gold_1.14
Oakfolks coop game
Loading...
Searching...
No Matches
AMiniGameSystem Class Reference

Core system for cooperative mini-games with QTE integration. More...

#include <MiniGameSystem.h>

Inheritance diagram for AMiniGameSystem:
Collaboration diagram for AMiniGameSystem:

Public Member Functions

 AMiniGameSystem ()
 Initializes the mini-game system with default components.
 
virtual void BeginPlay () override
 Initializes snap point mappings and item lists.
 
virtual void Tick (float DeltaTime) override
 Updates the system each frame.
 
virtual void SetInputItem (TArray< TSubclassOf< APickableItem > > _items)
 Sets the required input items for this machine.
 
virtual void SetQTE (UQTEConfigurationAsset *_datas)
 Sets the QTE configuration for this machine.
 
virtual void SetOutputItem (TArray< TSubclassOf< APickableItem > > _items)
 Sets the items that will be produced upon successful completion.
 
void StartExecute ()
 Initiates the QTE execution if all conditions are met.
 
void CallQTEReader ()
 Starts the QTE sequence using the configured asset.
 
void FinishExecute (bool _success)
 Handles QTE completion and triggers item production.
 
void SpawnItem (int i)
 Spawns output items sequentially with delays.
 
void Reset ()
 Resets the machine to its initial state.
 
void PartialReset (TSubclassOf< APickableItem > itemClass)
 Partially restores an item to the required list.
 
void Interact_Implementation (AMainPlayer *Player)
 Handles player interaction without held objects.
 
void InteractWithObject_Implementation (AMainPlayer *Player, AActor *Object)
 Handles player interaction with held objects.
 
bool checkItemPresent ()
 Validates the presence and state of deposited items.
 
int checkItemInRecipe (APickableItem *item)
 Checks if an item is required by the current recipe.
 
void SetPresentItem (APickableItem *item)
 Adds an item to the present items tracking.
 
void RemoveItemFromList (int i)
 Removes an item from the required list by index.
 
bool PlayerIsInBox (AMainPlayer *Player)
 Checks if a player is within the machine's interaction area.
 
void OnFirstSnapPointResult (EQTEResult Result)
 
void OnFirstSnapPointResult_Implementation (EQTEResult Result)
 Callback for first snap point QTE results.
 
void OnSecondSnapPointResult (EQTEResult Result)
 
void OnSecondSnapPointResult_Implementation (EQTEResult Result)
 Callback for second snap point QTE results.
 
void OnFirstSnapPointProgress (const FQTEActionProgress &Progress)
 
void OnFirstSnapPointProgress_Implementation (const FQTEActionProgress &Progress)
 Callback for first snap point progress updates.
 
void OnSecondSnapPointProgress (const FQTEActionProgress &Progress)
 
void OnSecondSnapPointProgress_Implementation (const FQTEActionProgress &Progress)
 Callback for second snap point progress updates.
 
void OnQTEComplete (const bool bSuccess)
 
void OnQTEComplete_Implementation (const bool bSuccess)
 Callback for overall QTE completion.
 
UBillboardComponent * GetNearestComponent (FVector ToLocation, TArray< UBillboardComponent * > Components)
 Finds the nearest snap point component to a given location.
 
- Public Member Functions inherited from IInteractable
void Interact (AMainPlayer *Player)
 
void InteractWithObject (AMainPlayer *Player, AActor *Object)
 Object-specific interaction.
 

Public Attributes

UBillboardComponent * snapPlayerPoint1
 
UBillboardComponent * snapPlayerPoint2
 
UBillboardComponent * outputSpawnPoint
 
TMap< UBillboardComponent *, AMainPlayer * > snapPointMap
 
UBoxComponent * inputBox
 Zone.
 

Detailed Description

Core system for cooperative mini-games with QTE integration.

Manages player snap points, item requirements, QTE execution, and production output

Constructor & Destructor Documentation

◆ AMiniGameSystem()

AMiniGameSystem::AMiniGameSystem ( )

Initializes the mini-game system with default components.

Sets up snap points, collision box, and enables tick functionality

Member Function Documentation

◆ BeginPlay()

void AMiniGameSystem::BeginPlay ( )
overridevirtual

Initializes snap point mappings and item lists.

Sets up the initial state for player tracking and item management

◆ CallQTEReader()

void AMiniGameSystem::CallQTEReader ( )

Starts the QTE sequence using the configured asset.

Initializes the QTE subsystem with the assigned configuration

Here is the caller graph for this function:

◆ checkItemInRecipe()

int AMiniGameSystem::checkItemInRecipe ( APickableItem * item)

Checks if an item is required by the current recipe.

Searches the required item list for a matching item type

Parameters
itemThe pickable item to validate against the recipe
Returns
Index of the item in the recipe, or -1 if not found
Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkItemPresent()

bool AMiniGameSystem::checkItemPresent ( )

Validates the presence and state of deposited items.

ITEM MANAGEMENT //////// Item validation and tracking

Checks if deposited items are still valid and removes invalid ones

Returns
True if items are present, false if the machine is empty
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FinishExecute()

void AMiniGameSystem::FinishExecute ( bool _success)

Handles QTE completion and triggers item production.

Cleans up QTE callbacks and spawns output items on success

Parameters
_successWhether the QTE was completed successfully
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetNearestComponent()

UBillboardComponent * AMiniGameSystem::GetNearestComponent ( FVector ToLocation,
TArray< UBillboardComponent * > Components )

Finds the nearest snap point component to a given location.

Utility method for determining optimal player positioning

Parameters
ToLocationThe reference location to measure distance from
ComponentsArray of billboard components to check
Returns
The closest billboard component to the specified location
Here is the caller graph for this function:

◆ Interact_Implementation()

void AMiniGameSystem::Interact_Implementation ( AMainPlayer * Player)

Handles player interaction without held objects.

INTERFACE IMPLEMENTATION //////// IInteractable methods

Manages snap point assignment and locomotion configuration

Parameters
PlayerThe player attempting to interact with the machine
Here is the call graph for this function:

◆ InteractWithObject_Implementation()

void AMiniGameSystem::InteractWithObject_Implementation ( AMainPlayer * Player,
AActor * Object )

Handles player interaction with held objects.

Validates and processes item deposits into the machine

Parameters
PlayerThe player interacting with the machine
ObjectThe object the player is holding
Here is the call graph for this function:

◆ OnFirstSnapPointProgress_Implementation()

void AMiniGameSystem::OnFirstSnapPointProgress_Implementation ( const FQTEActionProgress & Progress)

Callback for first snap point progress updates.

Receives real-time progress information for player 1

Parameters
ProgressCurrent progress data for the QTE action
Here is the call graph for this function:

◆ OnFirstSnapPointResult()

void AMiniGameSystem::OnFirstSnapPointResult ( EQTEResult Result)

QTE CALLBACKS //////// QTE event responses

Here is the caller graph for this function:

◆ OnFirstSnapPointResult_Implementation()

void AMiniGameSystem::OnFirstSnapPointResult_Implementation ( EQTEResult Result)

Callback for first snap point QTE results.

Handles and logs QTE action results for player 1

Parameters
ResultThe result of the QTE action (Success/Failure/None)
Here is the call graph for this function:

◆ OnQTEComplete_Implementation()

void AMiniGameSystem::OnQTEComplete_Implementation ( const bool bSuccess)

Callback for overall QTE completion.

Handles the final result of the entire QTE sequence

Parameters
bSuccessWhether the complete QTE sequence was successful
Here is the call graph for this function:

◆ OnSecondSnapPointProgress_Implementation()

void AMiniGameSystem::OnSecondSnapPointProgress_Implementation ( const FQTEActionProgress & Progress)

Callback for second snap point progress updates.

Receives real-time progress information for player 2

Parameters
ProgressCurrent progress data for the QTE action
Here is the call graph for this function:

◆ OnSecondSnapPointResult_Implementation()

void AMiniGameSystem::OnSecondSnapPointResult_Implementation ( EQTEResult Result)

Callback for second snap point QTE results.

Handles and logs QTE action results for player 2

Parameters
ResultThe result of the QTE action (Success/Failure/None)
Here is the call graph for this function:

◆ PartialReset()

void AMiniGameSystem::PartialReset ( TSubclassOf< APickableItem > itemClass)

Partially restores an item to the required list.

Used when an item is removed from the machine area

Parameters
itemClassThe item class to restore to the required list
Here is the caller graph for this function:

◆ PlayerIsInBox()

bool AMiniGameSystem::PlayerIsInBox ( AMainPlayer * Player)

Checks if a player is within the machine's interaction area.

Validates player position against the input box bounds

Parameters
PlayerThe player to check positioning for
Returns
True if the player is within the interaction box
Here is the caller graph for this function:

◆ RemoveItemFromList()

void AMiniGameSystem::RemoveItemFromList ( int i)

Removes an item from the required list by index.

Used when an item requirement has been fulfilled

Parameters
iIndex of the item to remove from the required list

◆ Reset()

void AMiniGameSystem::Reset ( )

Resets the machine to its initial state.

Restores the required item list to its original configuration

◆ SetInputItem()

void AMiniGameSystem::SetInputItem ( TArray< TSubclassOf< APickableItem > > _items)
virtual

Sets the required input items for this machine.

CONFIGURATION //////// System setup

Configures which items are needed to activate the mini-game

Parameters
_itemsArray of pickable item classes required as input

◆ SetOutputItem()

void AMiniGameSystem::SetOutputItem ( TArray< TSubclassOf< APickableItem > > _items)
virtual

Sets the items that will be produced upon successful completion.

Configures the output items spawned after QTE success

Parameters
_itemsArray of pickable item classes to produce as output

◆ SetPresentItem()

void AMiniGameSystem::SetPresentItem ( APickableItem * item)

Adds an item to the present items tracking.

Registers a deposited item with its class for validation

Parameters
itemThe pickable item to track as present

◆ SetQTE()

void AMiniGameSystem::SetQTE ( UQTEConfigurationAsset * _datas)
virtual

Sets the QTE configuration for this machine.

Assigns the Quick Time Event sequence to be executed

Parameters
_datasQTE configuration asset containing the sequence setup

◆ SpawnItem()

void AMiniGameSystem::SpawnItem ( int i)

Spawns output items sequentially with delays.

Recursively spawns items from the output list with timed intervals

Parameters
iIndex of the item to spawn in the output array
Here is the call graph for this function:
Here is the caller graph for this function:

◆ StartExecute()

void AMiniGameSystem::StartExecute ( )

Initiates the QTE execution if all conditions are met.

WORKFLOW //////// Execute minigames

Checks item requirements and player positioning before starting QTE

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Tick()

void AMiniGameSystem::Tick ( float DeltaTime)
overridevirtual

Updates the system each frame.

Currently handles any per-frame logic for the mini-game system

Parameters
DeltaTimeTime elapsed since the last frame in seconds

Member Data Documentation

◆ snapPlayerPoint1

UBillboardComponent* AMiniGameSystem::snapPlayerPoint1

COMPONENTS //////// Billboard snap points


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