2022-05-23 18:41:30 +00:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "AttributeSet.h"
|
2022-09-13 07:18:28 +00:00
|
|
|
#include "Delegates/Delegate.h"
|
|
|
|
#include "HAL/PlatformMisc.h"
|
|
|
|
#include "UObject/UObjectGlobals.h"
|
2022-05-23 18:41:30 +00:00
|
|
|
|
2022-09-13 07:18:28 +00:00
|
|
|
#include "LyraAttributeSet.generated.h"
|
2022-05-23 18:41:30 +00:00
|
|
|
|
2022-09-13 07:18:28 +00:00
|
|
|
class AActor;
|
2022-05-23 18:41:30 +00:00
|
|
|
class ULyraAbilitySystemComponent;
|
2022-09-13 07:18:28 +00:00
|
|
|
class UObject;
|
|
|
|
class UWorld;
|
2022-05-23 18:41:30 +00:00
|
|
|
struct FGameplayEffectSpec;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This macro defines a set of helper functions for accessing and initializing attributes.
|
|
|
|
*
|
|
|
|
* The following example of the macro:
|
|
|
|
* ATTRIBUTE_ACCESSORS(ULyraHealthSet, Health)
|
|
|
|
* will create the following functions:
|
|
|
|
* static FGameplayAttribute GetHealthAttribute();
|
|
|
|
* float GetHealth() const;
|
|
|
|
* void SetHealth(float NewVal);
|
|
|
|
* void InitHealth(float NewVal);
|
|
|
|
*/
|
|
|
|
#define ATTRIBUTE_ACCESSORS(ClassName, PropertyName) \
|
|
|
|
GAMEPLAYATTRIBUTE_PROPERTY_GETTER(ClassName, PropertyName) \
|
|
|
|
GAMEPLAYATTRIBUTE_VALUE_GETTER(PropertyName) \
|
|
|
|
GAMEPLAYATTRIBUTE_VALUE_SETTER(PropertyName) \
|
|
|
|
GAMEPLAYATTRIBUTE_VALUE_INITTER(PropertyName)
|
|
|
|
|
|
|
|
|
|
|
|
// Delegate used to broadcast attribute events.
|
|
|
|
DECLARE_MULTICAST_DELEGATE_FourParams(FLyraAttributeEvent, AActor* /*EffectInstigator*/, AActor* /*EffectCauser*/, const FGameplayEffectSpec& /*EffectSpec*/, float /*EffectMagnitude*/);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* ULyraAttributeSet
|
|
|
|
*
|
|
|
|
* Base attribute set class for the project.
|
|
|
|
*/
|
|
|
|
UCLASS()
|
|
|
|
class LYRAGAME_API ULyraAttributeSet : public UAttributeSet
|
|
|
|
{
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
ULyraAttributeSet();
|
|
|
|
|
|
|
|
UWorld* GetWorld() const override;
|
|
|
|
|
|
|
|
ULyraAbilitySystemComponent* GetLyraAbilitySystemComponent() const;
|
|
|
|
};
|