Files
UnrealEngineUWP/Engine/Source/Runtime/GameplayTasks/Classes/GameplayTaskOwnerInterface.h
Mieszko Zielinski 20e4252b50 Gameplay Task priority and resources management up and running, pass 1 #UE4
Including:
- every GameplayTask can specify resources it requires to run, and separately resources it's going to lock, or "shadow" ones in the priority queue
- added a broadcast delegate to GameplayTasksComponent one can register for to get notified about changes in resource locks
    - AI uses this to lock AI logic for scripted tasks
- made IGameplayTaskOwnerInterface::GetAvatarActor require a task pointer to determine avatar actor - this was needed for a "skeletal" owners, like BT nodes
- Improvements to AITask_MoveTo
- expanded BTTaskNode with bits required for it being a GameplayTask owner
    - might need to move that to the most generic BTNode so that services can easily spawn tasks as well
- BT movement tasks can now use AITasks (opt-in with AISystem::bEnableBTAITasks via Project Settings)
- started adding a generic mechanism for configuring AI properties via Project Settings
    - consistency throughout multiple ways of spawning given AI task being the main drive here. Started with movement of course
    - currently implemented by exposing AISystem's properties to global config. Going to switch that over to UDeveloperSettings soon.
- Added a blackboard component member to AIController
- added setting BB SelfActor key to AI-controlled Pawn

[CL 2597132 by Mieszko Zielinski in Main branch]
2015-06-23 11:05:27 -04:00

34 lines
1.2 KiB
C++

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Interface.h"
#include "GameplayTaskOwnerInterface.generated.h"
class UGameplayTasksComponent;
class UGameplayTask;
class AActor;
namespace FGameplayTasks
{
static const uint8 DefaultPriority = 127;
}
UINTERFACE(MinimalAPI, meta = (CannotImplementInterfaceInBlueprint))
class UGameplayTaskOwnerInterface : public UInterface
{
GENERATED_BODY()
};
class GAMEPLAYTASKS_API IGameplayTaskOwnerInterface
{
GENERATED_BODY()
public:
virtual void OnTaskInitialized(UGameplayTask& Task);
virtual UGameplayTasksComponent* GetGameplayTasksComponent(const UGameplayTask& Task) const = 0;
/** this gets called both when task starts and when task gets resumed. Check Task.GetStatus() if you want to differenciate */
virtual void OnTaskActivated(UGameplayTask& Task) = 0;
/** this gets called both when task finished and when task gets paused. Check Task.GetStatus() if you want to differenciate */
virtual void OnTaskDeactivated(UGameplayTask& Task) = 0;
virtual AActor* GetOwnerActor(const UGameplayTask* Task) const = 0;
virtual AActor* GetAvatarActor(const UGameplayTask* Task) const;
virtual uint8 GetDefaultPriority() const { return FGameplayTasks::DefaultPriority; }
};