#pragma once #include "CoreMinimal.h" #include "Components/ActorComponent.h" #include "ChangedStateSigDelegate.h" #include "StateStats.h" #include "GroundToAirComponent.generated.h" class ADeepPathfinderCharacter; class UDeepPathfinderMovement; UCLASS(Blueprintable, ClassGroup=Custom, meta=(BlueprintSpawnableComponent)) class UGroundToAirComponent : public UActorComponent { GENERATED_BODY() public: UPROPERTY(BlueprintAssignable, BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true)) FChangedStateSig OnChangedPathfinderState; protected: UPROPERTY(BlueprintReadWrite, EditAnywhere, Instanced, meta=(AllowPrivateAccess=true)) UDeepPathfinderMovement* CurrentMove; UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true)) float WalkTime; UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true)) float WalkTimeMaxRandomOffset; UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true)) float WalkTimeMinRandomOffset; UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true)) bool WalkUseTimer; UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true)) FStateStats WalkStats; UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true)) float FlyTime; UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true)) float FlyTimeMaxRandomOffset; UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true)) float FlyTimeMinRandomOffset; UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true)) bool FlyUseTimer; UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true)) FStateStats FlyStats; UPROPERTY(BlueprintReadWrite, EditAnywhere, ReplicatedUsing=OnRep_StateChange, meta=(AllowPrivateAccess=true)) bool IsFlying; UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true)) TWeakObjectPtr OwningPathfinder; public: UGroundToAirComponent(); virtual void GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const override; UFUNCTION(BlueprintCallable) void SetIsFlying(bool aIsFlying); UFUNCTION(BlueprintCallable) void SetAllowedToChangeState(bool aIsAllowed); protected: UFUNCTION(BlueprintCallable) void OnRep_StateChange(); public: UFUNCTION(BlueprintCallable, BlueprintPure) bool GetIsWalking() const; UFUNCTION(BlueprintCallable, BlueprintPure) bool GetIsFlying() const; UFUNCTION(BlueprintCallable) void Engage(); };