Operating System Simulator Plugin  3.5.1
Unreal Engine plugin that simulates an Operating System Environment
Loading...
Searching...
No Matches
FOperatingSystemRangeTime Struct Reference

#include "OperatingSystemRangeTime.h"

Public Member Functions

FORCEINLINE bool IsValid () const
 
FORCEINLINE float GetTime (const float FallbackTime=1.f) const
 
 FOperatingSystemRangeTime ()
 
 FOperatingSystemRangeTime (const float &MinTime, const float &MaxTime)
 

Detailed Description

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
}
Definition OperatingSystemRangeTime.h:27

Constructor & Destructor Documentation

◆ FOperatingSystemRangeTime() [1/2]

FOperatingSystemRangeTime::FOperatingSystemRangeTime ( )
inline

Default constructor for the FOperatingSystemRangeTime class.

Initializes the MinTime to 0 and the MaxTime to 1.

◆ FOperatingSystemRangeTime() [2/2]

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

Creates a new instance of FOperatingSystemRangeTime with the specified minimum and maximum times.

Parameters
MinTimeThe minimum time (in seconds) for the range. Must be >= 0 and <= MaxTime.
MaxTimeThe maximum time (in seconds) for the range. Must be > 0 and >= MinTime.

Member Function Documentation

◆ GetTime()

FORCEINLINE float FOperatingSystemRangeTime::GetTime ( const float FallbackTime = 1.f) const
inline

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.

Parameters
FallbackTimeThe fallback time to return if the range is not valid. Default is 1.f.
Returns
A random time within the range of MinTime to MaxTime, or the fallback time if the range is not valid.
Here is the caller graph for this function:

◆ IsValid()

FORCEINLINE bool FOperatingSystemRangeTime::IsValid ( ) const
inline

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.
Returns
True if the range of time is valid, false otherwise.
Here is the caller graph for this function:

The documentation for this struct was generated from the following file: