Files
BusyRabbit/Source/BusyRabbit/Public/Level/LevelPlayerState.h
2025-09-24 13:57:17 +08:00

61 lines
1.1 KiB
C++

#pragma once
#include "LuaPlayerState.h"
#include "LevelPlayerState.generated.h"
class ABusyPlayerRole;
DECLARE_LOG_CATEGORY_EXTERN(LogLevelPlayerState, Log, All);
UCLASS()
class ALevelPlayerState : public ALuaPlayerState
{
GENERATED_BODY()
public:
virtual void BeginPlay() override;
virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
public: // 给蓝图初始化的接口
UFUNCTION(BlueprintCallable)
AActor* CreateRoleRoster(class APlayerController* PlayerController);
public: // 给蓝图的Get接口
UFUNCTION(BlueprintCallable)
ABusyPlayerRole* GetControlledRole() const;
public: // 给蓝图的Set接口
UFUNCTION(BlueprintCallable)
void SetRoleRoster(const TArray<ABusyPlayerRole*>& Roster);
public:
public:
protected:
virtual FVector2D GetSpawnLocation()const;
public:
UPROPERTY(EditAnywhere, BlueprintReadOnly)
TArray<TSubclassOf<ABusyPlayerRole>> RoleClasses;
protected:
UPROPERTY(Replicated, BlueprintReadOnly)
int ControlledRoleIndex = -1;
UPROPERTY(Replicated, BlueprintReadOnly)
TArray<ABusyPlayerRole*> RoleRoster;
};