// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "GameFramework/Actor.h" #include "BasePawn.h" #include "AIController.h" #include "LevelLocation.h" #include "EnemySpawner.generated.h" UCLASS() class PRESIDENTSBRIGADE_API AEnemySpawner : public AActor { GENERATED_BODY() public: // Sets default values for this actor's properties AEnemySpawner(); // Called every frame virtual void Tick(float DeltaTime) override; protected: // Called when the game starts or when spawned virtual void BeginPlay() override; /** * Delay between spawning each enemy in seconds. */ UPROPERTY(EditAnywhere, Category = "Enemy") float spawn_delay_s; /** * Enemy pawn class. */ UPROPERTY(EditAnywhere, Category = "Enemy") TSubclassOf pawn_class; /** * Enemy controller class. */ UPROPERTY(EditAnywhere, Category = "Enemy") TSubclassOf controller_class; /** * Enemy spawn location marker. */ UPROPERTY(EditAnywhere, Category = "Enemy") UClass* marker_class; /** * Max number of enemies to spawn in one cycle. */ UPROPERTY(EditAnywhere, Category = "Enemy") int max_spawn_count; private: /** * Level location. */ TUniquePtr level_location; /** * Random number stream. */ FRandomStream random; /** * Threshold in seconds to wait before spawning. */ float next_spawn_threshold_s; /** * Current wait time in seconds. */ float spawn_wait_s; };