Highroad Engine v1.3
Public Types | Public Member Functions | Public Attributes | Protected Attributes | Properties | List of all members
MoreMountains.Tools.MMCooldown Class Reference

A class to handle cooldown related properties and their resource consumption over time Remember to initialize it (once) and update it every frame from another class More...

Public Types

enum  CooldownStates { Idle , Consuming , PauseOnEmpty , Refilling }
 all possible states for the object More...
 

Public Member Functions

virtual void Initialization ()
 An init method that ensures the object is reset More...
 
virtual void Start ()
 Starts consuming the cooldown object if possible More...
 
virtual bool Ready ()
 
virtual void Stop ()
 Stops consuming the object More...
 
virtual void Update ()
 Processes the object's state machine More...
 

Public Attributes

bool Unlimited = false
 if this is true, the cooldown won't do anything More...
 
float ConsumptionDuration = 2f
 the time it takes, in seconds, to consume the object More...
 
float PauseOnEmptyDuration = 1f
 the pause to apply before refilling once the object's been depleted More...
 
float RefillDuration = 1f
 the duration of the refill, in seconds, if uninterrupted More...
 
bool CanInterruptRefill = true
 whether or not the refill can be interrupted by a new Start instruction More...
 
CooldownStates CooldownState = CooldownStates.Idle
 the current state of the object More...
 
float CurrentDurationLeft
 the amount of duration left in the object at any given time More...
 

Protected Attributes

WaitForSeconds _pauseOnEmptyWFS
 
float _emptyReachedTimestamp = 0f
 

Properties

float Progress [get]
 

Detailed Description

A class to handle cooldown related properties and their resource consumption over time Remember to initialize it (once) and update it every frame from another class

Member Enumeration Documentation

◆ CooldownStates

all possible states for the object

Enumerator
Idle 
Consuming 
PauseOnEmpty 
Refilling 

Member Function Documentation

◆ Initialization()

virtual void MoreMountains.Tools.MMCooldown.Initialization ( )
virtual

An init method that ensures the object is reset

◆ Ready()

virtual bool MoreMountains.Tools.MMCooldown.Ready ( )
virtual

◆ Start()

virtual void MoreMountains.Tools.MMCooldown.Start ( )
virtual

Starts consuming the cooldown object if possible

◆ Stop()

virtual void MoreMountains.Tools.MMCooldown.Stop ( )
virtual

Stops consuming the object

◆ Update()

virtual void MoreMountains.Tools.MMCooldown.Update ( )
virtual

Processes the object's state machine

Member Data Documentation

◆ _emptyReachedTimestamp

float MoreMountains.Tools.MMCooldown._emptyReachedTimestamp = 0f
protected

◆ _pauseOnEmptyWFS

WaitForSeconds MoreMountains.Tools.MMCooldown._pauseOnEmptyWFS
protected

◆ CanInterruptRefill

bool MoreMountains.Tools.MMCooldown.CanInterruptRefill = true

whether or not the refill can be interrupted by a new Start instruction

◆ ConsumptionDuration

float MoreMountains.Tools.MMCooldown.ConsumptionDuration = 2f

the time it takes, in seconds, to consume the object

◆ CooldownState

CooldownStates MoreMountains.Tools.MMCooldown.CooldownState = CooldownStates.Idle

the current state of the object

◆ CurrentDurationLeft

float MoreMountains.Tools.MMCooldown.CurrentDurationLeft

the amount of duration left in the object at any given time

◆ PauseOnEmptyDuration

float MoreMountains.Tools.MMCooldown.PauseOnEmptyDuration = 1f

the pause to apply before refilling once the object's been depleted

◆ RefillDuration

float MoreMountains.Tools.MMCooldown.RefillDuration = 1f

the duration of the refill, in seconds, if uninterrupted

◆ Unlimited

bool MoreMountains.Tools.MMCooldown.Unlimited = false

if this is true, the cooldown won't do anything

Property Documentation

◆ Progress

float MoreMountains.Tools.MMCooldown.Progress
get

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