41 lines
967 B
C++
41 lines
967 B
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:
|
|
/** Input Buffer component */
|
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "UFE|Input", meta = (AllowPrivateAccess = "true"))
|
|
UFEInputBufferComponent* InputBuffer;
|
|
|
|
int32 Inputs;
|
|
|
|
TArray<int32> UnacknowledgedInputs;
|
|
};
|