|
@@ -16,17 +16,6 @@ enum class EAbilityRunStatus : uint8
|
|
Unset,
|
|
Unset,
|
|
};
|
|
};
|
|
|
|
|
|
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
-///Frame
|
|
|
|
-USTRUCT()
|
|
|
|
-struct EZABILITY_API FEzAbilityFrame
|
|
|
|
-{
|
|
|
|
- GENERATED_BODY()
|
|
|
|
-
|
|
|
|
- UPROPERTY()
|
|
|
|
- TObjectPtr<class UEzAbility> Ability = nullptr;
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
///Slice
|
|
///Slice
|
|
UENUM()
|
|
UENUM()
|
|
@@ -37,7 +26,7 @@ enum class ESliceType
|
|
};
|
|
};
|
|
|
|
|
|
USTRUCT(BlueprintType)
|
|
USTRUCT(BlueprintType)
|
|
-struct EZABILITY_API FEzAbilitySliceHandle
|
|
|
|
|
|
+struct EZABILITY_API FEzAbilityStateHandle
|
|
{
|
|
{
|
|
GENERATED_BODY()
|
|
GENERATED_BODY()
|
|
|
|
|
|
@@ -46,18 +35,18 @@ struct EZABILITY_API FEzAbilitySliceHandle
|
|
static constexpr uint16 FailedIndex = uint16(-3); // Index value indicating a Failed state.
|
|
static constexpr uint16 FailedIndex = uint16(-3); // Index value indicating a Failed state.
|
|
static constexpr uint16 StoppedIndex = uint16(-4); // Index value indicating a Stopped state.
|
|
static constexpr uint16 StoppedIndex = uint16(-4); // Index value indicating a Stopped state.
|
|
|
|
|
|
- static const FEzAbilitySliceHandle Invalid;
|
|
|
|
- static const FEzAbilitySliceHandle Succeeded;
|
|
|
|
- static const FEzAbilitySliceHandle Failed;
|
|
|
|
- static const FEzAbilitySliceHandle Stopped;
|
|
|
|
- static const FEzAbilitySliceHandle Root;
|
|
|
|
|
|
+ static const FEzAbilityStateHandle Invalid;
|
|
|
|
+ static const FEzAbilityStateHandle Succeeded;
|
|
|
|
+ static const FEzAbilityStateHandle Failed;
|
|
|
|
+ static const FEzAbilityStateHandle Stopped;
|
|
|
|
+ static const FEzAbilityStateHandle Root;
|
|
|
|
|
|
static bool IsValidIndex(const int32 Index) { return Index >= 0 && Index < (int32)MAX_uint16; }
|
|
static bool IsValidIndex(const int32 Index) { return Index >= 0 && Index < (int32)MAX_uint16; }
|
|
- friend FORCEINLINE uint32 GetTypeHash(const FEzAbilitySliceHandle& Handle) { return GetTypeHash(Handle.Index); }
|
|
|
|
|
|
+ friend FORCEINLINE uint32 GetTypeHash(const FEzAbilityStateHandle& Handle) { return GetTypeHash(Handle.Index); }
|
|
|
|
|
|
- FEzAbilitySliceHandle() = default;
|
|
|
|
- explicit FEzAbilitySliceHandle(const uint16 InIndex) : Index(InIndex) {}
|
|
|
|
- explicit FEzAbilitySliceHandle(const int32 InIndex) : Index()
|
|
|
|
|
|
+ FEzAbilityStateHandle() = default;
|
|
|
|
+ explicit FEzAbilityStateHandle(const uint16 InIndex) : Index(InIndex) {}
|
|
|
|
+ explicit FEzAbilityStateHandle(const int32 InIndex) : Index()
|
|
{
|
|
{
|
|
check(InIndex == INDEX_NONE || IsValidIndex(InIndex));
|
|
check(InIndex == INDEX_NONE || IsValidIndex(InIndex));
|
|
Index = InIndex == INDEX_NONE ? InvalidIndex : static_cast<uint16>(InIndex);
|
|
Index = InIndex == INDEX_NONE ? InvalidIndex : static_cast<uint16>(InIndex);
|
|
@@ -67,8 +56,8 @@ struct EZABILITY_API FEzAbilitySliceHandle
|
|
void Invalidate() { Index = InvalidIndex; }
|
|
void Invalidate() { Index = InvalidIndex; }
|
|
bool IsCompletionState() const { return Index == SucceededIndex || Index == FailedIndex || Index == StoppedIndex; }
|
|
bool IsCompletionState() const { return Index == SucceededIndex || Index == FailedIndex || Index == StoppedIndex; }
|
|
|
|
|
|
- bool operator==(const FEzAbilitySliceHandle& RHS) const { return Index == RHS.Index; }
|
|
|
|
- bool operator!=(const FEzAbilitySliceHandle& RHS) const { return Index != RHS.Index; }
|
|
|
|
|
|
+ bool operator==(const FEzAbilityStateHandle& RHS) const { return Index == RHS.Index; }
|
|
|
|
+ bool operator!=(const FEzAbilityStateHandle& RHS) const { return Index != RHS.Index; }
|
|
|
|
|
|
FString Describe() const
|
|
FString Describe() const
|
|
{
|
|
{
|
|
@@ -83,18 +72,18 @@ struct EZABILITY_API FEzAbilitySliceHandle
|
|
}
|
|
}
|
|
|
|
|
|
EAbilityRunStatus ToCompletionStatus() const;
|
|
EAbilityRunStatus ToCompletionStatus() const;
|
|
- static FEzAbilitySliceHandle FromCompletionStatus(const EAbilityRunStatus Status);
|
|
|
|
|
|
+ static FEzAbilityStateHandle FromCompletionStatus(const EAbilityRunStatus Status);
|
|
|
|
|
|
UPROPERTY()
|
|
UPROPERTY()
|
|
uint16 Index = InvalidIndex;
|
|
uint16 Index = InvalidIndex;
|
|
};
|
|
};
|
|
|
|
|
|
USTRUCT()
|
|
USTRUCT()
|
|
-struct EZABILITY_API FCompactEzAbilitySlice
|
|
|
|
|
|
+struct EZABILITY_API FCompactEzAbilityState
|
|
{
|
|
{
|
|
GENERATED_BODY()
|
|
GENERATED_BODY()
|
|
|
|
|
|
- FCompactEzAbilitySlice();
|
|
|
|
|
|
+ FCompactEzAbilityState();
|
|
|
|
|
|
uint16 GetNextIndex() const { return ChildrenEnd; };
|
|
uint16 GetNextIndex() const { return ChildrenEnd; };
|
|
bool HasChildren() const { return ChildrenEnd > ChildrenBegin; };
|
|
bool HasChildren() const { return ChildrenEnd > ChildrenBegin; };
|
|
@@ -109,7 +98,7 @@ struct EZABILITY_API FCompactEzAbilitySlice
|
|
FName Name;
|
|
FName Name;
|
|
|
|
|
|
UPROPERTY()
|
|
UPROPERTY()
|
|
- FEzAbilitySliceHandle Parent = FEzAbilitySliceHandle::Invalid;
|
|
|
|
|
|
+ FEzAbilityStateHandle Parent = FEzAbilityStateHandle::Invalid;
|
|
|
|
|
|
UPROPERTY()
|
|
UPROPERTY()
|
|
float StartTime;
|
|
float StartTime;
|
|
@@ -134,7 +123,24 @@ struct EZABILITY_API FCompactEzAbilityTransition
|
|
FCompactEzAbilityTransition();
|
|
FCompactEzAbilityTransition();
|
|
|
|
|
|
UPROPERTY()
|
|
UPROPERTY()
|
|
- FEzAbilitySliceHandle State = FEzAbilitySliceHandle::Invalid;
|
|
|
|
|
|
+ FEzAbilityStateHandle State = FEzAbilityStateHandle::Invalid;
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
+///Frame
|
|
|
|
+USTRUCT()
|
|
|
|
+struct EZABILITY_API FEzAbilityFrame
|
|
|
|
+{
|
|
|
|
+ GENERATED_BODY()
|
|
|
|
+
|
|
|
|
+ UPROPERTY()
|
|
|
|
+ TObjectPtr<class UEzAbility> Ability = nullptr;
|
|
|
|
+
|
|
|
|
+ UPROPERTY()
|
|
|
|
+ uint8 bIsGlobalFrame : 1 = false;
|
|
|
|
+
|
|
|
|
+ UPROPERTY()
|
|
|
|
+ FEzAbilityStateHandle RootState = FEzAbilityStateHandle::Root;
|
|
};
|
|
};
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
@@ -146,4 +152,6 @@ struct EZABILITY_API FEzAbilityExecutionState
|
|
|
|
|
|
UPROPERTY()
|
|
UPROPERTY()
|
|
TArray<FEzAbilityFrame> ActiveFrames;
|
|
TArray<FEzAbilityFrame> ActiveFrames;
|
|
|
|
+
|
|
|
|
+ void Reset();
|
|
};
|
|
};
|