Files
UnrealEngineUWP/Engine/Source/Runtime/GameplayTasks/Classes/GameplayTaskOwnerInterface.h
ryan durand 0f0464a30e Updating copyright for Engine Runtime.
#rnx
#rb none


#ROBOMERGE-OWNER: ryan.durand
#ROBOMERGE-AUTHOR: ryan.durand
#ROBOMERGE-SOURCE: CL 10869210 via CL 10869511 via CL 10869900
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870549 by ryan durand in Main branch]
2019-12-26 14:45:42 -05:00

46 lines
1.8 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "UObject/ObjectMacros.h"
#include "UObject/Interface.h"
#include "GameplayTaskTypes.h"
#include "GameplayTaskOwnerInterface.generated.h"
class AActor;
class UGameplayTask;
class UGameplayTasksComponent;
UINTERFACE(MinimalAPI, meta = (CannotImplementInterfaceInBlueprint))
class UGameplayTaskOwnerInterface : public UInterface
{
GENERATED_BODY()
};
class GAMEPLAYTASKS_API IGameplayTaskOwnerInterface
{
GENERATED_BODY()
public:
/** Finds tasks component for given GameplayTask, Task.GetGameplayTasksComponent() may not be initialized at this point! */
virtual UGameplayTasksComponent* GetGameplayTasksComponent(const UGameplayTask& Task) const PURE_VIRTUAL(IGameplayTaskOwnerInterface::GetGameplayTasksComponent, return nullptr;);
/** Get owner of a task or default one when task is null */
virtual AActor* GetGameplayTaskOwner(const UGameplayTask* Task) const PURE_VIRTUAL(IGameplayTaskOwnerInterface::GetGameplayTaskOwner, return nullptr;);
/** Get "body" of task's owner / default, having location in world (e.g. Owner = AIController, Avatar = Pawn) */
virtual AActor* GetGameplayTaskAvatar(const UGameplayTask* Task) const { return GetGameplayTaskOwner(Task); }
/** Get default priority for running a task */
virtual uint8 GetGameplayTaskDefaultPriority() const { return FGameplayTasks::DefaultPriority; }
/** Notify called after GameplayTask finishes initialization (not active yet) */
virtual void OnGameplayTaskInitialized(UGameplayTask& Task) {}
/** Notify called after GameplayTask changes state to Active (initial activation or resuming) */
virtual void OnGameplayTaskActivated(UGameplayTask& Task) {}
/** Notify called after GameplayTask changes state from Active (finishing or pausing) */
virtual void OnGameplayTaskDeactivated(UGameplayTask& Task) {}
};