Otter  0.9.8.91
2d Game Development Framework based on SFML.Net
 All Classes Namespaces Functions Variables Enumerations Properties
Otter.AutoTimer Class Reference

A timer that automatically counts on an increment. Useful for handling things like cooldowns. More...

Inherits Otter.Component.

Public Member Functions

 AutoTimer (float max)
 Create an AutoTimer. More...
 
 AutoTimer (float value, float min, float max, float increment)
 Create an AutoTimer. More...
 
override void Update ()
 Update the AutoTimer. More...
 
void Reset ()
 Reset the timer to 0. More...
 
void Pause ()
 Pause the timer. More...
 
void Resume ()
 Resume the timer if paused. More...
 
void Start ()
 Start the timer again from 0. More...
 
void Stop ()
 Stop the timer and set the value to 0. More...
 
- Public Member Functions inherited from Otter.Component
GetEntity< T > ()
 Get the Entity as a specific Type. More...
 
virtual void Added ()
 Called when the Component is added to the Entity. More...
 
virtual void Removed ()
 Called when the Component is removed from the Entity. More...
 
void RemoveSelf ()
 Removes the Component from its parent Entity. More...
 
virtual void UpdateFirst ()
 Called during the UpdateFirst on the parent Entity. More...
 
virtual void Render ()
 Called during the Render on the parent Entity. More...
 
virtual void UpdateLast ()
 Called during the UpdateLast on the parent Entity. More...
 
GetComponent< T > ()
 Gets the first Component of type T from this Component's Entity. More...
 
List< T > GetComponents< T > ()
 Gets a list of Components of type T from this Component's Entity. More...
 

Static Public Member Functions

static implicit operator float (AutoTimer timer)
 
static implicit operator int (AutoTimer timer)
 

Public Attributes

float Value
 The current value of the timer. More...
 
float Max
 The maximum possible value of the timer. More...
 
float Min
 The minimum possible value of the timer. More...
 
float Increment = 1
 How much the timer increments each update. More...
 
- Public Attributes inherited from Otter.Component
Entity Entity
 The parent Entity of the Component. More...
 
bool RenderAfterEntity = true
 Determines if the Component should render after the Entity has rendered. More...
 
bool Visible = true
 Determines if the Component will render. More...
 
float Timer = 0
 How long the Component has been alive (added to an Entity and updated.) More...
 

Properties

bool Paused [get, set]
 If the timer is currently paused. More...
 
bool AtMax [get]
 If the timer is currently at its maximum value. More...
 
bool AtMin [get]
 If the timer is currently at its minimum value. More...
 
- Properties inherited from Otter.Component
int InstanceId [get, set]
 The Component's id for the Entity its attached to. More...
 
Scene Scene [get]
 The Scene that the parent Entity is in. More...
 
Collider Collider [get]
 The first Collider of the parent Entity. More...
 
Graphic Graphic [get]
 The first Graphic of the parent Entity. More...
 
List< GraphicGraphics [get]
 The list of Graphics from the parent Entity. More...
 
List< ColliderColliders [get]
 The list of Colliders from the parent Entity. More...
 

Detailed Description

A timer that automatically counts on an increment. Useful for handling things like cooldowns.

Constructor & Destructor Documentation

Otter.AutoTimer.AutoTimer ( float  max)

Create an AutoTimer.

Parameters
maxThe maximum value of the timer.
Otter.AutoTimer.AutoTimer ( float  value,
float  min,
float  max,
float  increment 
)

Create an AutoTimer.

Parameters
valueThe initial value of the timer.
minThe minimum value of the timer.
maxThe maximum value of the timer.
incrementThe value that the timer increments with each update.

Member Function Documentation

void Otter.AutoTimer.Pause ( )

Pause the timer.

void Otter.AutoTimer.Reset ( )

Reset the timer to 0.

void Otter.AutoTimer.Resume ( )

Resume the timer if paused.

void Otter.AutoTimer.Start ( )

Start the timer again from 0.

void Otter.AutoTimer.Stop ( )

Stop the timer and set the value to 0.

override void Otter.AutoTimer.Update ( )
virtual

Update the AutoTimer.

Reimplemented from Otter.Component.

Member Data Documentation

float Otter.AutoTimer.Increment = 1

How much the timer increments each update.

float Otter.AutoTimer.Max

The maximum possible value of the timer.

float Otter.AutoTimer.Min

The minimum possible value of the timer.

float Otter.AutoTimer.Value

The current value of the timer.

Property Documentation

bool Otter.AutoTimer.AtMax
get

If the timer is currently at its maximum value.

bool Otter.AutoTimer.AtMin
get

If the timer is currently at its minimum value.

bool Otter.AutoTimer.Paused
getset

If the timer is currently paused.


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