2023-06-05 21:02:11 +00:00
|
|
|
// 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:
|
2023-06-10 17:57:51 +00:00
|
|
|
/** MappingContext */
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "UFE|Input", meta = (AllowPrivateAccess = "true"))
|
|
|
|
class UInputMappingContext* DefaultMappingContext;
|
|
|
|
|
2023-06-05 21:02:11 +00:00
|
|
|
/** Input Buffer component */
|
|
|
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "UFE|Input", meta = (AllowPrivateAccess = "true"))
|
|
|
|
UFEInputBufferComponent* InputBuffer;
|
|
|
|
|
|
|
|
int32 Inputs;
|
|
|
|
|
|
|
|
TArray<int32> UnacknowledgedInputs;
|
|
|
|
};
|