Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 22 additions & 10 deletions tests/Utils/InputRecordingUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,56 +5,68 @@
#include "CoreMinimal.h"
#include "InputRecordingUtils.generated.h"

/**
* @brief Struct representing axis data.
*/
USTRUCT()
struct FAxisData
{
GENERATED_BODY()

UPROPERTY()
FName Name;
FName Name; /**< The name of the axis. */

UPROPERTY()
float Value;
float Value; /**< The value of the axis. */
};

/**
* @brief Struct representing action data.
*/
USTRUCT()
struct FActionData
{
GENERATED_BODY()

UPROPERTY()
FName Name;
FName Name; /**< The name of the action. */

UPROPERTY()
FKey Key;
FKey Key; /**< The key associated with the action. */

UPROPERTY()
bool State;
bool State; /**< The state of the action. */
};

/**
* @brief Struct representing input bindings data.
*/
USTRUCT()
struct FBindingsData
{
GENERATED_BODY()

UPROPERTY()
TArray<FAxisData> AxisValues;
TArray<FAxisData> AxisValues; /**< The array of axis values. */

UPROPERTY()
TArray<FActionData> ActionValues;
TArray<FActionData> ActionValues; /**< The array of action values. */

UPROPERTY()
float WorldTime{0.0f};
float WorldTime{0.0f}; /**< The world time. */
};

/**
* @brief Struct representing input data.
*/
USTRUCT()
struct FInputData
{
GENERATED_BODY()

UPROPERTY()
TArray<FBindingsData> Bindings;
TArray<FBindingsData> Bindings; /**< The array of input bindings data. */

UPROPERTY()
FTransform InitialTransform;
FTransform InitialTransform; /**< The initial transform. */
};
16 changes: 16 additions & 0 deletions tests/Utils/JsonUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,26 @@ namespace LifeExe
namespace Test
{

/**
* @brief Utility class for handling JSON operations
*/
class JsonUtils
{
public:
/**
* @brief Writes input data to a JSON file.
* @param FileName The name of the JSON file to write to.
* @param InputData The input data to write.
* @return True if the data is successfully written, false otherwise.
*/
static bool WriteInputData(const FString& FileName, const FInputData& InputData);

/**
* @brief Reads input data from a JSON file.
* @param FileName The name of the JSON file to read from.
* @param InputData The input data to read into.
* @return True if the data is successfully read, false otherwise.
*/
static bool ReadInputData(const FString& FileName, FInputData& InputData);
};

Expand Down
Loading