#include <MortarProPoolSubsystem.h>
◆ AddToPool()
void UMortarProPoolSubsystem::AddToPool |
( |
AActor * |
ActorToAdd, |
|
|
TSubclassOf< AActor > |
SubClass |
|
) |
| |
|
private |
Adds an actor in the Map for later reference If the size exceeds the maximum limit it will delete 10 actors from pool and then add
- Parameters
-
[in] | ActorToAdd | Actor To add in The pool. |
[in] | SubClass | Type of the actor. |
◆ BPInitializeResourceManagement()
void UMortarProPoolSubsystem::BPInitializeResourceManagement |
( |
| ) |
|
Event Called on Initializing subsystem which will be handled in blueprint The Blueprint should specify the actors and the number of maximum actors that can be spawned
◆ GetActorFromPool()
AActor * UMortarProPoolSubsystem::GetActorFromPool |
( |
TSubclassOf< AActor > |
SubClass, |
|
|
const FVector & |
Location, |
|
|
const FRotator & |
Rotation, |
|
|
const FActorSpawnParameters & |
SpawnParams |
|
) |
| |
Function That Gets Actor From Pool. It will spawn a new projectile if we haven't hit the limit for each actor.
- Parameters
-
[in] | SubClass | class of actor to spawn |
[in] | Location | Location To Spawn |
[in] | Rotation | Rotation with which we spawn projectile |
[in] | SpawnParams | Spawn Parameter to use while spawning actor |
- Returns
- Actor newly spawned or reused from pool
◆ Initialize()
virtual void UMortarProPoolSubsystem::Initialize |
( |
FSubsystemCollectionBase & |
Collection | ) |
|
|
privatevirtual |
◆ RemoveFromPool()
bool UMortarProPoolSubsystem::RemoveFromPool |
( |
AActor * |
ActorToRemove, |
|
|
TSubclassOf< AActor > |
SubClass |
|
) |
| |
Removes an actor From The Tarray. Note It Doesn't Destory The Actor
- Parameters
-
[in] | ActorToRemove | Actor To Remove from The pool |
[in] | SubClass | Class of the actor |
- Returns
- True if Actor Found in the pool False Otherwise
◆ SetResourceCount()
void UMortarProPoolSubsystem::SetResourceCount |
( |
const TMap< TSubclassOf< AActor >, int32 > & |
ResourceCount | ) |
|
|
private |
Sets Resource Count For Each Type Of Actor We gonna see it
- Parameters
-
[in] | ResourceCount | Map Of Type of Actor and the total number of resources we gonna see in a level |
◆ ShouldCreateSubsystem()
virtual bool UMortarProPoolSubsystem::ShouldCreateSubsystem |
( |
UObject * |
Outer | ) |
const |
|
inlineprivatevirtual |
Tells UE5 whether this subsystem is to be loaded for all
- Returns
- True means initialize in all False means manually initialized
◆ MaxPoolSizePerActor
TMap<TSubclassOf<AActor>, int32> UMortarProPoolSubsystem::MaxPoolSizePerActor |
|
private |
Map Containing Pool Size for each class of actor
◆ Pool
TMap<TSubclassOf<AActor>, TArray<AActor*> > UMortarProPoolSubsystem::Pool |
|
private |
Map Containing Tarray of Actors For each type of actor Specified This is a pool Which stores all the actors used
The documentation for this class was generated from the following file:
- Public/Misc/MortarProPoolSubsystem.h