LEAP Documentation 40220
Documentation for the LEAP project
SpawnTargetInterface.h
Go to the documentation of this file.
1// Copyright Blue Isle Studios Inc 2018. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "UObject/Interface.h"
7#include "SpawnTargetInterface.generated.h"
8
10
11UINTERFACE(meta=(CannotImplementInterfaceInBlueprint))
12class USpawnTargetInterface : public UInterface
13{
14 GENERATED_UINTERFACE_BODY()
15};
16
17class PROJECTX_API ISpawnTargetInterface
18{
19 GENERATED_IINTERFACE_BODY()
20
21public:
22 virtual void RegisterActorForScoring();
23 virtual void DeRegisterActorForScoring();
24 //Returns true if this target can be spawned on by a given instigator.
25 UFUNCTION(BlueprintCallable, Category = SpawnTargetInterface)
26 virtual bool CanSpawnPlayer(const AProjectXPlayerState* Instigator) const { return false; }
27
28 //Returns transform for an actor to use when spawning on this actor. bValid will be true if the given FTransform is a valid one. Implementations may return different FTransforms every call.
29 UFUNCTION(BlueprintCallable, Category = SpawnTargetInterface)
30 virtual bool GetSpawnLocation(AProjectXPlayerState* Instigator, FTransform& Transform) const { return false; }
31 //Returns a score for spawn systems so that each actor can
32 UFUNCTION(BlueprintCallable, Category = SpawnTargetInterface)
33 virtual float GetSpawnScoreForInstigator(const AActor* const QueryInstigator, FVector& TargetLocation, bool bUseDistanceToTargetLocation = false) const { return 0.f; }
34 UFUNCTION(BlueprintCallable, Category = SpawnTargetInterface)
35 virtual bool GetCanSpawnOnCombatTarget() const { return false; }
36 virtual void UpdateCanSpawnOnCombatTarget(bool bNewInCombatSpawnTarget) {}
37 static const void GetAverageEnemyTeamLocation(const UObject* Caller, TArray<AActor*>& AvailableSpawnPoints, FVector& AverageEnemyLocation);
38 static AActor* GetFurthestLocationFromOtherPlayers(const UObject* Caller, TArray<AActor*>& AvailableSpawnPoints);
39 static AActor* GetRandomSafeSpawnLocation(const UObject* Caller, TArray<AActor*>& AvailableSpawnPoints, float MaximumSpawnDistance, float MinimumSpawnDistance);
40 virtual bool ShouldRegisterForScoringOnStart() const { return true; }
41};
Definition: ProjectXPlayerState.h:238
Definition: SpawnTargetInterface.h:18
virtual bool ShouldRegisterForScoringOnStart() const
Definition: SpawnTargetInterface.h:40
virtual void UpdateCanSpawnOnCombatTarget(bool bNewInCombatSpawnTarget)
Definition: SpawnTargetInterface.h:36
Definition: SpawnTargetInterface.h:13