Rebornbuddy
Loading...
Searching...
No Matches
ff14bot.Helpers.FrameCachedValue< T > Class Template Reference

Provides simple and accessible caching. Values are cached for one game frame. Most logic is already cached at the memory level, this is useful for caching the results of complex logic. More...

Public Member Functions

 FrameCachedValue (Func< T > retriever)
 Creates a new CachedValue of the specified type, stored for the specified timespan.
override string ToString ()
 Returns a System.String that represents this instance.

Static Public Member Functions

static implicit operator T (FrameCachedValue< T > fcv)
 Implicit conversion to generic type, gets Value

Properties

Value [get]
 Gets the value this Cache holds. Returns the cached value if the specified duration has not expired, and a "fresh" value if it has.
RealValue [get]
 Gets the real, non-cached value. Calling this does not affect the cache itself, and does not reset any of its timers.

Detailed Description

Provides simple and accessible caching. Values are cached for one game frame. Most logic is already cached at the memory level, this is useful for caching the results of complex logic.

Template Parameters
T
Type Constraints
T :struct 

Member Function Documentation

◆ FrameCachedValue()

ff14bot.Helpers.FrameCachedValue< T >.FrameCachedValue ( Func< T > retriever)

Creates a new CachedValue of the specified type, stored for the specified timespan.

Parameters
retrieverThe retriever.

◆ operator T()

implicit ff14bot.Helpers.FrameCachedValue< T >.operator T ( FrameCachedValue< T > fcv)
static

Implicit conversion to generic type, gets Value

Parameters
fcv

◆ ToString()

override string ff14bot.Helpers.FrameCachedValue< T >.ToString ( )

Returns a System.String that represents this instance.

Returns
A System.String that represents this instance.

Property Documentation

◆ RealValue

T ff14bot.Helpers.FrameCachedValue< T >.RealValue
get

Gets the real, non-cached value. Calling this does not affect the cache itself, and does not reset any of its timers.

◆ Value

T ff14bot.Helpers.FrameCachedValue< T >.Value
get

Gets the value this Cache holds. Returns the cached value if the specified duration has not expired, and a "fresh" value if it has.

The value.