UnrealFightingFramework/Source/UnrealFightingEngine/Input/FEPlayerController.h

45 lines
1.1 KiB
C++

// Unreal Fighting Engine by Kevin Poretti
#pragma once
// UE includes
#include "CoreMinimal.h"
#include "GameFramework/PlayerController.h"
#include "FEPlayerController.generated.h"
/**
* A class that collects player inputs, stores them in an input buffer, and sends a rolling window of
* unacknowledged inputs to a remote client or server for processing.
*/
UCLASS()
class UNREALFIGHTINGENGINE_API AFEPlayerController : public APlayerController
{
GENERATED_BODY()
public:
AFEPlayerController();
/**
* Sends all unacknowledged inputs to the remote
*/
void SendInputsToRemote() const;
// APlayerController interface
virtual void SetupInputComponent() override;
// End of APlayerController interface
protected:
/** MappingContext */
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UFE|Input", meta = (AllowPrivateAccess = "true"))
class UInputMappingContext* DefaultMappingContext;
/** Input Buffer component */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "UFE|Input", meta = (AllowPrivateAccess = "true"))
UFEInputBufferComponent* InputBuffer;
int32 Inputs;
TArray<int32> UnacknowledgedInputs;
};