File size: 2,038 Bytes
7fd553e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Copyright Epic Games, Inc. All Rights Reserved.

#pragma once

#include "AttributeSet.h"

#include "LyraAttributeSet.generated.h"

#define UE_API LYRAGAME_API

class AActor;
class ULyraAbilitySystemComponent;
class UObject;
class UWorld;
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, some of these parameters may be null on clients: 

 * @param EffectInstigator	The original instigating actor for this event

 * @param EffectCauser		The physical actor that caused the change

 * @param EffectSpec		The full effect spec for this change

 * @param EffectMagnitude	The raw magnitude, this is before clamping

 * @param OldValue			The value of the attribute before it was changed

 * @param NewValue			The value after it was changed

*/
DECLARE_MULTICAST_DELEGATE_SixParams(FLyraAttributeEvent, AActor* /*EffectInstigator*/, AActor* /*EffectCauser*/, const FGameplayEffectSpec* /*EffectSpec*/, float /*EffectMagnitude*/, float /*OldValue*/, float /*NewValue*/);

/**

 * ULyraAttributeSet

 *

 *	Base attribute set class for the project.

 */
UCLASS(MinimalAPI)
class ULyraAttributeSet : public UAttributeSet
{
	GENERATED_BODY()

public:

	UE_API ULyraAttributeSet();

	UE_API UWorld* GetWorld() const override;

	UE_API ULyraAbilitySystemComponent* GetLyraAbilitySystemComponent() const;
};

#undef UE_API