Otter
0.9.8.91
2d Game Development Framework based on SFML.Net
|
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 | |
T | 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... | |
T | 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< Graphic > | Graphics [get] |
The list of Graphics from the parent Entity. More... | |
List< Collider > | Colliders [get] |
The list of Colliders from the parent Entity. More... | |
A timer that automatically counts on an increment. Useful for handling things like cooldowns.
Otter.AutoTimer.AutoTimer | ( | float | max | ) |
Create an AutoTimer.
max | The maximum value of the timer. |
Otter.AutoTimer.AutoTimer | ( | float | value, |
float | min, | ||
float | max, | ||
float | increment | ||
) |
Create an AutoTimer.
value | The initial value of the timer. |
min | The minimum value of the timer. |
max | The maximum value of the timer. |
increment | The value that the timer increments with each update. |
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.
|
virtual |
Update the AutoTimer.
Reimplemented from Otter.Component.
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.
|
get |
If the timer is currently at its maximum value.
|
get |
If the timer is currently at its minimum value.
|
getset |
If the timer is currently paused.