109 lines
2.7 KiB
C++
109 lines
2.7 KiB
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "NpcDatabase.h"
|
|
#include "QuestDatabase.h"
|
|
#include "TimeOfDayManager.h"
|
|
#include "QuestDatabase.h"
|
|
#include "GameFramework/Actor.h"
|
|
#include "OrderManager.generated.h"
|
|
|
|
UCLASS(Blueprintable)
|
|
class PROJECTELERI_API AOrderManager : public AActor
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
// Sets default values for this actor's properties
|
|
AOrderManager();
|
|
|
|
//TODO Save variable
|
|
UPROPERTY(VisibleAnywhere)
|
|
int32 LastCheckedMonth;
|
|
|
|
UPROPERTY(VisibleAnywhere)
|
|
TArray<FQuest> QuestQueue;
|
|
|
|
UPROPERTY(VisibleAnywhere)
|
|
ATimeOfDayManager* TimeOfDayActor;
|
|
|
|
UPROPERTY(EditDefaultsOnly)
|
|
UQuestDatabase* QuestDatabase;
|
|
|
|
UPROPERTY(EditDefaultsOnly)
|
|
UNpcDatabase* NpcDatabase;
|
|
|
|
UPROPERTY(EditAnywhere)
|
|
int32 QuestsCompletedLastDay = 2;
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Quest")
|
|
TArray<FQuestItem> QuestList;
|
|
|
|
UFUNCTION()
|
|
void OnDayPassedResponse();
|
|
|
|
protected:
|
|
// Called when the game starts or when spawned
|
|
virtual void BeginPlay() override;
|
|
|
|
public:
|
|
// Called every frame
|
|
virtual void Tick(float DeltaTime) override;
|
|
|
|
UFUNCTION(BlueprintCallable, BlueprintNativeEvent, Category="Quests")
|
|
FQuest FindQuest(FName QuestID, bool& sucess);
|
|
FQuest FindQuest_Implementation(FName QuestID, bool& sucess);
|
|
|
|
bool FindQuest(FName QuestID, FQuestItem& Quest);
|
|
UFUNCTION(BlueprintCallable)
|
|
void ReadQuest(FName QuestID);
|
|
UFUNCTION(BlueprintCallable)
|
|
void MarkQuestCompleted(FName QuestID);
|
|
bool CheckIfPrerequisiteQuestIsCompleted(FName QuestID);
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
bool CheckIfQuestComplete(FName QuestID, FQuestItem& QuestItem);
|
|
|
|
TArray<FQuest> GetIncompleteQuests();
|
|
void AcceptQuest(FName QuestID, int32 currentDay, int32 response, TArray<FName> itemArray);
|
|
void AcceptQuest(FName QuestID, int32 currentDay);
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
bool SubmitAnswerWithItems(FName QuestID, int32 ResponseIndex, TArray<FName> ItemIndexes);
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
void SubmitAnswer(FName QuestID, int32 ResponseIndex);
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
FQuest GetQuestInfo(FName QuestID);
|
|
|
|
//Helpers for accepted quests
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
TArray<FQuestItem> GetAllAcceptedQuestForSaving();
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
void LoadQuestsIntoMemory(TArray<FQuestItem> quests);
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
FQuestItem GetAcceptedQuestInfo(FName QuestID);
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
TArray<FQuest> GetAllAcceptedQuests(FName NpcID);
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
TArray<FNpcQuest> GetAllDifferentNpcs();
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
FNpc GetNpc(FName NpcID);
|
|
|
|
|
|
//Helpers for unaccepted quests
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
TArray<FNpcQuest> GetQuestsByNpc();
|
|
|
|
};
|