Files
Fortis/Source/FORTIS_Taktika/Private/ResComStatistics.cpp
T
2022-06-29 14:10:51 +05:00

36 lines
736 B
C++

// Fill out your copyright notice in the Description page of Project Settings.
#include "ResComStatistics.h"
void UResComStatistics::NewState(FString state)
{
if (prevState.duration != 0.0f)
{
prevState.duration = GetWorld()->GetTimeSeconds() - prevState.duration;
stateHistory.Add(prevState);
}
prevState.state = state;
prevState.duration = GetWorld()->GetTimeSeconds();
}
FString UResComStatistics::GetStateHistoryString()
{
FString strTmp("");
for (auto& state : stateHistory)
{
strTmp += "->" + state.state;
}
return strTmp;
}
void UResComStatistics::StartVR()
{
timeLastStartVR = GetWorld()->GetTimeSeconds();
}
void UResComStatistics::EndVR()
{
timeVR += GetWorld()->GetTimeSeconds() - timeLastStartVR;
}