2023-03-13 05:19:13 +00:00
|
|
|
|
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "CoreMinimal.h"
|
|
|
|
|
#include "Components/ActorComponent.h"
|
2023-03-13 18:11:42 +00:00
|
|
|
|
#include "Components/TextBlock.h"
|
2023-03-14 01:33:06 +00:00
|
|
|
|
#include "Blueprint/UserWidget.h"
|
2023-03-29 16:36:24 +00:00
|
|
|
|
#include "Quest.h"
|
2023-03-13 05:19:13 +00:00
|
|
|
|
#include "QuestSystem.generated.h"
|
|
|
|
|
|
|
|
|
|
UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
|
|
|
|
|
class THE_TWILIGHT_ABYSS_API UQuestSystem : public UActorComponent
|
|
|
|
|
{
|
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
// Sets default values for this component's properties
|
|
|
|
|
UQuestSystem();
|
|
|
|
|
|
2023-03-29 16:36:24 +00:00
|
|
|
|
TArray<UQuest*> ActiveQuests;
|
|
|
|
|
TArray<UQuest*> CompletedQuests;
|
|
|
|
|
TArray<FString> CompletedQuestLines;
|
|
|
|
|
TMap<FString, bool> QuestFlags;
|
|
|
|
|
|
2023-03-13 05:19:13 +00:00
|
|
|
|
protected:
|
|
|
|
|
// Called when the game starts
|
|
|
|
|
virtual void BeginPlay() override;
|
|
|
|
|
|
2023-03-13 18:11:42 +00:00
|
|
|
|
UPROPERTY()
|
|
|
|
|
TSubclassOf<UUserWidget> QuestWidget;
|
|
|
|
|
|
2023-03-29 16:36:24 +00:00
|
|
|
|
FJsonObject WorldStateJsonTemplate;
|
|
|
|
|
|
2023-03-13 05:19:13 +00:00
|
|
|
|
public:
|
|
|
|
|
// Called every frame
|
|
|
|
|
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
|
2023-03-29 16:36:24 +00:00
|
|
|
|
void CheckActiveQuestConditions();
|
|
|
|
|
FJsonObject GetWorldState();
|
2023-03-13 05:19:13 +00:00
|
|
|
|
};
|