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

Base Component class. Components can be added to Entities. More...

Inherited by Otter.Alarm, Otter.AutoTimer, Otter.Axis, Otter.Bone, Otter.Button, Otter.Controller, Otter.Counter, Otter.EventProcessor, Otter.GridCounter, Otter.IRC, Otter.Lerper, Otter.Movement, Otter.SineWave, Otter.Skeleton, Otter.Snake, Otter.StateMachine< TState >, Otter.UI.UIManager, and Otter.Vertebra.

Public Member Functions

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 Update ()
 Called during the Update 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

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

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

Base Component class. Components can be added to Entities.

Member Function Documentation

virtual void Otter.Component.Added ( )
virtual

Called when the Component is added to the Entity.

Reimplemented in Otter.Bone, and Otter.Snake.

T Otter.Component.GetComponent< T > ( )

Gets the first Component of type T from this Component's Entity.

Template Parameters
TThe type of the Component.
Returns
The first Component of type T from the Entity's Components.
Type Constraints
T :Component 
List<T> Otter.Component.GetComponents< T > ( )

Gets a list of Components of type T from this Component's Entity.

Template Parameters
TThe type of the Components.
Returns
A list of Components of type T from the Entity's Components.
Type Constraints
T :Component 
virtual void Otter.Component.Removed ( )
virtual

Called when the Component is removed from the Entity.

void Otter.Component.RemoveSelf ( )

Removes the Component from its parent Entity.

virtual void Otter.Component.Render ( )
virtual

Called during the Render on the parent Entity.

Reimplemented in Otter.Skeleton, Otter.Bone, and Otter.UI.UIManager.

virtual void Otter.Component.UpdateFirst ( )
virtual

Called during the UpdateFirst on the parent Entity.

Reimplemented in Otter.Axis, Otter.Button, and Otter.Controller.

virtual void Otter.Component.UpdateLast ( )
virtual

Called during the UpdateLast on the parent Entity.

Member Data Documentation

Entity Otter.Component.Entity

The parent Entity of the Component.

bool Otter.Component.RenderAfterEntity = true

Determines if the Component should render after the Entity has rendered.

float Otter.Component.Timer = 0

How long the Component has been alive (added to an Entity and updated.)

bool Otter.Component.Visible = true

Determines if the Component will render.

Property Documentation

Collider Otter.Component.Collider
get

The first Collider of the parent Entity.

List<Collider> Otter.Component.Colliders
get

The list of Colliders from the parent Entity.

Graphic Otter.Component.Graphic
get

The first Graphic of the parent Entity.

List<Graphic> Otter.Component.Graphics
get

The list of Graphics from the parent Entity.

Scene Otter.Component.Scene
get

The Scene that the parent Entity is in.


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