File size: 1,743 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 "GameFramework/PlayerStart.h"
#include "GameplayTagContainer.h"
#include "LyraPlayerStart.generated.h"
#define UE_API LYRAGAME_API
class AController;
class UObject;
enum class ELyraPlayerStartLocationOccupancy
{
Empty,
Partial,
Full
};
/**
* ALyraPlayerStart
*
* Base player starts that can be used by a lot of modes.
*/
UCLASS(MinimalAPI, Config = Game)
class ALyraPlayerStart : public APlayerStart
{
GENERATED_BODY()
public:
UE_API ALyraPlayerStart(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get());
const FGameplayTagContainer& GetGameplayTags() { return StartPointTags; }
UE_API ELyraPlayerStartLocationOccupancy GetLocationOccupancy(AController* const ControllerPawnToFit) const;
/** Did this player start get claimed by a controller already? */
UE_API bool IsClaimed() const;
/** If this PlayerStart was not claimed, claim it for ClaimingController */
UE_API bool TryClaim(AController* OccupyingController);
protected:
/** Check if this PlayerStart is still claimed */
UE_API void CheckUnclaimed();
/** The controller that claimed this PlayerStart */
UPROPERTY(Transient)
TObjectPtr<AController> ClaimingController = nullptr;
/** Interval in which we'll check if this player start is not colliding with anyone anymore */
UPROPERTY(EditDefaultsOnly, Category = "Player Start Claiming")
float ExpirationCheckInterval = 1.f;
/** Tags to identify this player start */
UPROPERTY(EditAnywhere)
FGameplayTagContainer StartPointTags;
/** Handle to track expiration recurring timer */
FTimerHandle ExpirationTimerHandle;
};
#undef UE_API
|