Lost_Edge/Source/Lost_Edge/Private/Minigame/Minigame.h
2024-09-21 22:01:25 +02:00

61 lines
1.3 KiB
C++

// Oleg Petruny proprietary.
#pragma once
#include "GameFramework/Actor.h"
#include "Minigame.generated.h"
UENUM(BlueprintType)
enum class EMinigameResult : uint8
{
Loss,
Win,
};
DECLARE_DYNAMIC_DELEGATE_TwoParams(FMinigameEndCallback, EMinigameResult, result, int32, score);
UCLASS(Blueprintable, BlueprintType, MinimalAPI, Abstract)
class AMinigame : public AActor
{
GENERATED_BODY()
public:
AMinigame();
UFUNCTION(BlueprintCallable)
virtual void Start(class APlayerBase* playerPawn, FMinigameEndCallback delegate);
UFUNCTION(BlueprintImplementableEvent)
void OnStart();
UFUNCTION(BlueprintCallable)
virtual void End();
UFUNCTION(BlueprintCallable)
virtual void Restart();
UFUNCTION(BlueprintImplementableEvent)
void OnEnd();
UFUNCTION(BlueprintPure)
class UInputMappingContext* GetInputMappings();
protected:
FMinigameEndCallback callback;
class APlayerBase* player;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int32 score = 0;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
EMinigameResult result = EMinigameResult::Loss;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
bool ended = false;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
TSoftObjectPtr<class UInputMappingContext> input = nullptr;
};