LEAP Documentation 40220
Documentation for the LEAP project
DeployableControllable.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"
7#include "DeployableControllable.generated.h"
8
13class UStaticMeshComponent;
14
15UENUM()
17{
18 Up = 0,
19 Right = 1,
20 Down = 2,
21 Left = 3,
22 Forward = 4,
23 Back = 5
24};
25
26DECLARE_DYNAMIC_MULTICAST_DELEGATE(FDeployableControlSignature);
27
28UCLASS()
29class PROJECTX_API ADeployableControllable : public ADeployable
30{
31 GENERATED_UCLASS_BODY()
32
33public:
34 virtual void DeployComplete() override;
35 virtual void OnOwnerDied() override;
36 virtual void MoveDeployableForward(float Value) {}
37 virtual void MoveDeployableRight(float Value) {}
38 virtual void MoveDeployableUp(float Value) {}
39 virtual void Fire() {}
40 virtual void AssumeControl();
41 virtual void StopControlling();
42 virtual bool GetIsBeingControlled() { return bIsBeingControlled; }
43
44 UPROPERTY(BlueprintAssignable)
45 FDeployableControlSignature OnControlAssumed;
46 UPROPERTY(BlueprintAssignable)
47 FDeployableControlSignature OnControlLost;
48
49protected:
50 bool bIsOwnerDead = false;
51 FRotator PreviousEyesRotation = FRotator::ZeroRotator;
52
53protected:
54 virtual void BeginPlay() override;
55 virtual void Tick(float DeltaTime) override;
56 virtual void UpdateDeployableTransform(float DeltaTime) {}
57
58 UFUNCTION(BlueprintImplementableEvent, Category = Deployable)
59 void K2_OnControlAssumed();
60 UFUNCTION(BlueprintImplementableEvent, Category = Deployable)
61 void K2_OnControlLost();
62
63 UFUNCTION(Server, Unreliable)
64 virtual void Server_MoveDeployable_Unreliable(EDeployableMovementDirection Acceleration);
65 /* Get the deployable's mesh that will be interpolated throughout the location updates */
66 UFUNCTION(BlueprintNativeEvent, Category = Deployable)
67 UStaticMeshComponent* GetControlledMesh();
68 /* Using this instead of the deployable state as switching states from dormant to active re-trigger the deploy effect
69 which for this weapon they work a bit differently and we have to be careful with redeploys of the same controlled deployable */
70 bool bIsBeingControlled = false;
71};
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FDeployableControlSignature)
EDeployableMovementDirection
Definition: DeployableControllable.h:17
Definition: DeployableControllable.h:30
virtual bool GetIsBeingControlled()
Definition: DeployableControllable.h:42
virtual void MoveDeployableUp(float Value)
Definition: DeployableControllable.h:38
virtual void MoveDeployableForward(float Value)
Definition: DeployableControllable.h:36
virtual void MoveDeployableRight(float Value)
Definition: DeployableControllable.h:37
virtual void Fire()
Definition: DeployableControllable.h:39
Definition: Deployable.h:47