|
|
|
|
| #pragma once
|
|
|
| #include "AbilitySystemInterface.h"
|
| #include "ModularGameState.h"
|
|
|
| #include "LyraGameState.generated.h"
|
|
|
| #define UE_API LYRAGAME_API
|
|
|
| struct FLyraVerbMessage;
|
|
|
| class APlayerState;
|
| class UAbilitySystemComponent;
|
| class ULyraAbilitySystemComponent;
|
| class ULyraExperienceManagerComponent;
|
| class UObject;
|
| struct FFrame;
|
|
|
| |
| |
| |
| |
|
|
| UCLASS(MinimalAPI, Config = Game)
|
| class ALyraGameState : public AModularGameStateBase, public IAbilitySystemInterface
|
| {
|
| GENERATED_BODY()
|
|
|
| public:
|
|
|
| UE_API ALyraGameState(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get());
|
|
|
|
|
| UE_API virtual void PreInitializeComponents() override;
|
| UE_API virtual void PostInitializeComponents() override;
|
| UE_API virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
|
| UE_API virtual void Tick(float DeltaSeconds) override;
|
|
|
|
|
|
|
| UE_API virtual void AddPlayerState(APlayerState* PlayerState) override;
|
| UE_API virtual void RemovePlayerState(APlayerState* PlayerState) override;
|
| UE_API virtual void SeamlessTravelTransitionCheckpoint(bool bToTransitionMap) override;
|
|
|
|
|
|
|
| UE_API virtual UAbilitySystemComponent* GetAbilitySystemComponent() const override;
|
|
|
|
|
|
|
| UFUNCTION(BlueprintCallable, Category = "Lyra|GameState")
|
| ULyraAbilitySystemComponent* GetLyraAbilitySystemComponent() const { return AbilitySystemComponent; }
|
|
|
|
|
|
|
| UFUNCTION(NetMulticast, Unreliable, BlueprintCallable, Category = "Lyra|GameState")
|
| UE_API void MulticastMessageToClients(const FLyraVerbMessage Message);
|
|
|
|
|
|
|
| UFUNCTION(NetMulticast, Reliable, BlueprintCallable, Category = "Lyra|GameState")
|
| UE_API void MulticastReliableMessageToClients(const FLyraVerbMessage Message);
|
|
|
|
|
| UE_API float GetServerFPS() const;
|
|
|
|
|
| UE_API void SetRecorderPlayerState(APlayerState* NewPlayerState);
|
|
|
|
|
| UE_API APlayerState* GetRecorderPlayerState() const;
|
|
|
|
|
| DECLARE_MULTICAST_DELEGATE_OneParam(FOnRecorderPlayerStateChanged, APlayerState*);
|
| FOnRecorderPlayerStateChanged OnRecorderPlayerStateChangedEvent;
|
|
|
| private:
|
|
|
| UPROPERTY()
|
| TObjectPtr<ULyraExperienceManagerComponent> ExperienceManagerComponent;
|
|
|
|
|
| UPROPERTY(VisibleAnywhere, Category = "Lyra|GameState")
|
| TObjectPtr<ULyraAbilitySystemComponent> AbilitySystemComponent;
|
|
|
| protected:
|
| UPROPERTY(Replicated)
|
| float ServerFPS;
|
|
|
|
|
|
|
| UPROPERTY(Transient, ReplicatedUsing = OnRep_RecorderPlayerState)
|
| TObjectPtr<APlayerState> RecorderPlayerState;
|
|
|
| UFUNCTION()
|
| UE_API void OnRep_RecorderPlayerState();
|
|
|
| };
|
|
|
| #undef UE_API
|
|
|