![]() |
Gorgon Game Engine
|
Controllers are required to progress animations. More...
Public Member Functions | |
ControllerBase () | |
Default constructor. More... | |
ControllerBase (Governor &governor) | |
virtual | ~ControllerBase () |
Destructor. More... | |
virtual void | Add (Base &animation) |
This function attaches the given animation to this controller. More... | |
void | AutoDestruct () |
Set a flag that will automatically destroy this controller whenever it has no animations left to control. More... | |
virtual void | Delete (Base &animation) |
Deletes the given animation. More... | |
virtual unsigned | GetProgress () const =0 |
Returns the current progress of the timer. More... | |
virtual bool | IsControlled () const =0 |
This method allows clients to determine if the progress is controlled. More... | |
void | Keep () |
Resets the flag that will automatically destroy this controller whenever it has no animations left to control. More... | |
virtual void | Progress (unsigned timepassed)=0 |
Progresses this timer by moving the timer timepassed milliseconds forwards. More... | |
virtual void | Remove (Base &animation) |
Removes the given animation. More... | |
virtual void | Reset ()=0 |
Resets the animation to the start. More... | |
virtual void | SetGovernor (Governor &governor) |
Changes the governor of this controller. More... | |
Protected Attributes | |
Containers::Collection< Base > | animations |
List of animations this controller holds. More... | |
bool | collectable |
Whether this controller should be collected by the garbage collector when its task is finished. More... | |
Governor * | governor |
Controllers are required to progress animations.
ControllerBase | ( | ) |
Default constructor.
References Governor::Active(), and ControllerBase::governor.
|
explicit |
References ControllerBase::governor.
|
virtual |
Destructor.
References Governor::Active(), ControllerBase::governor, and LOG.
|
virtual |
This function attaches the given animation to this controller.
References ControllerBase::animations, and Base::SetController().
void AutoDestruct | ( | ) |
Set a flag that will automatically destroy this controller whenever it has no animations left to control.
References ControllerBase::collectable.
|
virtual |
Deletes the given animation.
References ControllerBase::animations.
|
pure virtual |
Returns the current progress of the timer.
Implemented in Timer, and ControlledTimer.
|
pure virtual |
This method allows clients to determine if the progress is controlled.
If the progress is not controlled, there is no way to force the animation to stop. Therefore, animations with looping capabilities should wrap around to start over. However, if the timer is a controller then the best strategy will be to stop at the end, and return the leftover time. This way, controller can decide what to do next.
Implemented in Controller, Timer, and ControlledTimer.
void Keep | ( | ) |
Resets the flag that will automatically destroy this controller whenever it has no animations left to control.
References ControllerBase::collectable.
|
pure virtual |
Progresses this timer by moving the timer timepassed milliseconds forwards.
Implemented in Controller, and Timer.
|
virtual |
Removes the given animation.
References ControllerBase::animations, and ControllerBase::collectable.
|
pure virtual |
Resets the animation to the start.
Animation controllers that do not support this request should silently ignore it.
Implemented in ControlledTimer, Controller, and Timer.
|
virtual |
Changes the governor of this controller.
References Governor::Active(), and ControllerBase::governor.
|
protected |
List of animations this controller holds.
|
protected |
Whether this controller should be collected by the garbage collector when its task is finished.
|
protected |