68 lines
1.3 KiB
C++
68 lines
1.3 KiB
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "UObject/NoExportTypes.h"
|
|
#include "ResComStatistics.generated.h"
|
|
|
|
/**
|
|
*
|
|
*/
|
|
|
|
USTRUCT(BlueprintType)
|
|
struct FStateAndTime
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
|
FString state;
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
|
float duration = 0.0f;
|
|
|
|
FStateAndTime() {};
|
|
FStateAndTime(FString s, float t) : state(s), duration(t) {};
|
|
};
|
|
|
|
USTRUCT(BlueprintType)
|
|
struct FUserStatistics
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
|
float timeSession = 0.0f;
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
|
float timeVR = 0.0f;
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
|
TArray<FStateAndTime> stateHistory;
|
|
};
|
|
|
|
UCLASS(BlueprintType)
|
|
class FORTIS_TAKTIKA_API UResComStatistics : public UObject
|
|
{
|
|
GENERATED_BODY()
|
|
protected:
|
|
float timeSession = 0.0f;
|
|
float timeVR = 0.0f;
|
|
TArray<FStateAndTime> stateHistory;
|
|
|
|
// start variables
|
|
float timeLastStartVR = 0.0f;
|
|
FStateAndTime prevState;
|
|
public:
|
|
UFUNCTION(BlueprintCallable, Category = "states")
|
|
void NewState(FString state);
|
|
|
|
UFUNCTION(BlueprintCallable, Category = "states")
|
|
FString GetStateHistoryString();
|
|
|
|
UFUNCTION(BlueprintCallable, Category = "VR")
|
|
void StartVR();
|
|
|
|
UFUNCTION(BlueprintCallable, Category = "VR")
|
|
void EndVR();
|
|
};
|