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

Component that counts down and executes a function. After it has executed it removes itself. More...

Inherits Otter.Component.

Public Member Functions

 Alarm (Action function, float delay)
 Create an Alarm. More...
 
override void Update ()
 Update the Alarm. 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...
 

Public Attributes

float Delay
 The amount of time that must pass before the function activates. More...
 
Action Function
 The method to call when the timer reaches the set delay. 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...
 

Additional Inherited Members

- 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

Component that counts down and executes a function. After it has executed it removes itself.

Constructor & Destructor Documentation

Otter.Alarm.Alarm ( Action  function,
float  delay 
)

Create an Alarm.

Parameters
functionThe method to call when the timer reaches the set delay.
delayThe amount of time that must pass before the method is called.

Member Function Documentation

override void Otter.Alarm.Update ( )
virtual

Update the Alarm.

Reimplemented from Otter.Component.

Member Data Documentation

float Otter.Alarm.Delay

The amount of time that must pass before the function activates.

Action Otter.Alarm.Function

The method to call when the timer reaches the set delay.


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