Skip to content

FOperatingSystemRangeTime

#include <OperatingSystemSimulator/Public/OperatingSystemRangeTime.h>
---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class FOperatingSystemRangeTime {
    +IsValid() const bool
    +GetTime(const float FallbackTime=1.f) const float
    +FOperatingSystemRangeTime()
    +FOperatingSystemRangeTime(const float &MinTime, const float &MaxTime)
    +MinTime : float
    +MaxTime : float
  }

Documented call sites inside the plugin (7):

flowchart LR
  FOperatingSystemRangeTime__GetTime["FOperatingSystemRangeTime::GetTime"]
  UOperatingSystemBaseDevice__DeviceCreated["UOperatingSystemBaseDevice::DeviceCreated"]
  UOperatingSystemBaseDevice__DeviceCreated --> FOperatingSystemRangeTime__GetTime
  UOperatingSystem__GetInitialLoadingTime["UOperatingSystem::GetInitialLoadingTime"]
  UOperatingSystem__GetInitialLoadingTime --> FOperatingSystemRangeTime__GetTime
  UOperatingSystem__GetInstallationTime["UOperatingSystem::GetInstallationTime"]
  UOperatingSystem__GetInstallationTime --> FOperatingSystemRangeTime__GetTime
  UOperatingSystem__GetLoadingTime["UOperatingSystem::GetLoadingTime"]
  UOperatingSystem__GetLoadingTime --> FOperatingSystemRangeTime__GetTime
  UOperatingSystemStatics__GetRangeTime["UOperatingSystemStatics::GetRangeTime"]
  UOperatingSystemStatics__GetRangeTime --> FOperatingSystemRangeTime__GetTime
  UOperatingSystemBaseDevice__Internal_OnDeviceSessionEnd["UOperatingSystemBaseDevice::Internal_OnDeviceSessionEnd"]
  UOperatingSystemBaseDevice__Internal_OnDeviceSessionEnd --> FOperatingSystemRangeTime__GetTime
  UOperatingSystemGameSubsystem__RequestFundsFromBank["UOperatingSystemGameSubsystem::RequestFundsFromBank"]
  UOperatingSystemGameSubsystem__RequestFundsFromBank --> FOperatingSystemRangeTime__GetTime
struct FOperatingSystemRangeTime

Defined in OperatingSystemRangeTime.h:26 Represents a range of time for an operating system.

An instance of this class contains a minimum time and a maximum time, both measured in seconds. The minimum time must be greater than or equal to zero and less than or equal to the maximum time. The maximum time must be greater than zero and greater than or equal to the minimum time.

The methods available in this class allow you to check if the range is valid and obtain a random time within the range.

Example usage:

FOperatingSystemRangeTime RangeTime(5.f, 10.f);
if (RangeTime.IsValid())
{
float RandomTime = RangeTime.GetTime();
// Use the random time within the range
}
ReturnNameDescription
boolIsValid const inlineChecks if the range of time is valid.
floatGetTime const inlineReturns a random time within the range of MinTime to MaxTime. If the range is not valid, it returns the FallbackTime parameter value. If the fallback time is less than 0.0001 then return 1.f.
FOperatingSystemRangeTime inlineDefault constructor for the FOperatingSystemRangeTime class.
FOperatingSystemRangeTime inlineCreates a new instance of FOperatingSystemRangeTime with the specified minimum and maximum times.

const inline

inline bool IsValid() const

Defined in OperatingSystemRangeTime.h:52 Checks if the range of time is valid.

The range of time is considered valid if the following conditions are met:

  • MinTime is greater than or equal to 0.

  • MaxTime is greater than UE_KINDA_SMALL_NUMBER.

  • MinTime is less than or equal to MaxTime.

True if the range of time is valid, false otherwise.


const inline

inline float GetTime(const float FallbackTime = 1.f) const

Defined in OperatingSystemRangeTime.h:62 Returns a random time within the range of MinTime to MaxTime. If the range is not valid, it returns the FallbackTime parameter value. If the fallback time is less than 0.0001 then return 1.f.

  • FallbackTime The fallback time to return if the range is not valid. Default is 1.f.

A random time within the range of MinTime to MaxTime, or the fallback time if the range is not valid.


inline

inline FOperatingSystemRangeTime()

Defined in OperatingSystemRangeTime.h:77 Default constructor for the FOperatingSystemRangeTime class.

Initializes the MinTime to 0 and the MaxTime to 1.


inline

inline FOperatingSystemRangeTime(const float & MinTime, const float & MaxTime)

Defined in OperatingSystemRangeTime.h:89 Creates a new instance of FOperatingSystemRangeTime with the specified minimum and maximum times.

  • MinTime The minimum time (in seconds) for the range. Must be >= 0 and <= MaxTime.

  • MaxTime The maximum time (in seconds) for the range. Must be > 0 and >= MinTime.

ReturnNameDescription
floatMinTimeMin time (in seconds) to calculate time. Must be >= 0 and <= MaxTime
floatMaxTimeMax time (in seconds) to calculate time. Must be > 0 and >= MinTime

float MinTime

Defined in OperatingSystemRangeTime.h:34 Min time (in seconds) to calculate time. Must be >= 0 and <= MaxTime


float MaxTime

Defined in OperatingSystemRangeTime.h:38 Max time (in seconds) to calculate time. Must be > 0 and >= MinTime