|
|
|
|
| #pragma once
|
|
|
| #include "Components/GameStateComponent.h"
|
|
|
| #include "LyraBotCreationComponent.generated.h"
|
|
|
| class ULyraExperienceDefinition;
|
| class ULyraPawnData;
|
| class AAIController;
|
|
|
| UCLASS(Blueprintable, Abstract)
|
| class ULyraBotCreationComponent : public UGameStateComponent
|
| {
|
| GENERATED_BODY()
|
|
|
| public:
|
| ULyraBotCreationComponent(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get());
|
|
|
|
|
| virtual void BeginPlay() override;
|
|
|
|
|
| private:
|
| void OnExperienceLoaded(const ULyraExperienceDefinition* Experience);
|
|
|
| protected:
|
| UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category=Gameplay)
|
| int32 NumBotsToCreate = 5;
|
|
|
| UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category=Gameplay)
|
| TSubclassOf<AAIController> BotControllerClass;
|
|
|
| UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category=Gameplay)
|
| TArray<FString> RandomBotNames;
|
|
|
| TArray<FString> RemainingBotNames;
|
|
|
| protected:
|
| UPROPERTY(Transient)
|
| TArray<TObjectPtr<AAIController>> SpawnedBotList;
|
|
|
|
|
| UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category=Gameplay)
|
| virtual void SpawnOneBot();
|
|
|
|
|
| UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category=Gameplay)
|
| virtual void RemoveOneBot();
|
|
|
|
|
| UFUNCTION(BlueprintNativeEvent, BlueprintAuthorityOnly, Category=Gameplay)
|
| void ServerCreateBots();
|
|
|
| #if WITH_SERVER_CODE
|
| public:
|
| void Cheat_AddBot() { SpawnOneBot(); }
|
| void Cheat_RemoveBot() { RemoveOneBot(); }
|
|
|
| FString CreateBotName(int32 PlayerIndex);
|
| #endif
|
| };
|
|
|