![]() |
Gorgon Game Engine
|
This class allows storing an animation instance regarless of its underlying type as a value. More...
Public Member Functions | |
basic_Instance ()=default | |
Empty constructor. More... | |
basic_Instance (A_ &instance, bool owner=true) | |
Filling constructor. More... | |
basic_Instance (basic_Instance &&other) | |
Move constructor. More... | |
basic_Instance (const basic_Instance &)=delete | |
Copy constructor is disabled for ownership reasons. More... | |
A_ & | GetAnimation () const |
Returns the animation stored in the object. More... | |
bool | HasAnimation () const |
Check if this instance has an animation. More... | |
bool | IsOwner () const |
Whether the stored animation is owned by this container. More... | |
A_ & | operator* () const |
Alias for GetAnimation. More... | |
A_ * | operator-> () const |
Alias for GetAnimation. More... | |
basic_Instance & | operator= (A_ &instance) |
Move assignment, owns the assigned object as CreateAnimation returns objects that needs to be owned. More... | |
basic_Instance & | operator= (basic_Instance &&other) |
Move assignment. More... | |
basic_Instance & | operator= (const basic_Instance &)=delete |
Copy assignment. More... | |
A_ * | Release () |
Removes the animation from the storage without destroying it. More... | |
void | Remove () |
Removes the animation stored in the container, if the container owns the animation, it will be destroyed. More... | |
void | SetAnimation (A_ &value, bool owner=true) |
Sets the animation stored in this container. More... | |
![]() | |
Base (bool create=false) | |
This constructor creates a new controller depending on the create parameter. More... | |
Base (const Base &base) | |
Copies the animation. More... | |
Base (ControllerBase &controller) | |
Sets the controller for this animation to the given controller. More... | |
virtual void | DeleteAnimation () const |
Deletes this animation. More... | |
virtual ControllerBase & | GetController () const |
Returns the controller of this animation. More... | |
virtual int | GetDuration () const =0 |
Returns the duration of the animation if it is a known apriori. More... | |
virtual bool | HasController () const |
Returns whether this animation has a controller. More... | |
virtual bool | Progress (unsigned &leftover)=0 |
This function should progress the animation. More... | |
virtual void | RemoveController () |
Removes the controller of this animation. More... | |
virtual void | SetController (ControllerBase &controller) |
Sets the controller to the given controller. More... | |
Additional Inherited Members | |
![]() | |
virtual | ~Base () |
Virtual destructor. More... | |
![]() | |
ControllerBase * | controller |
Controller of this animation. More... | |
This class allows storing an animation instance regarless of its underlying type as a value.
The contained animation can be destroyed along with the instance itself. Destruction process uses DeleteAnimation so that shared animations will not be destroyed.
|
default |
Empty constructor.
basic_Instance | ( | A_ & | instance, |
bool | owner = true |
||
) |
Filling constructor.
|
delete |
Copy constructor is disabled for ownership reasons.
basic_Instance | ( | basic_Instance< A_ > && | other | ) |
Move constructor.
A_& GetAnimation | ( | ) | const |
Returns the animation stored in the object.
If there is no animation provider stored, it will throw std::runtime_error
bool HasAnimation | ( | ) | const |
Check if this instance has an animation.
bool IsOwner | ( | ) | const |
Whether the stored animation is owned by this container.
A_& operator* | ( | ) | const |
Alias for GetAnimation.
References basic_Instance< A_ >::GetAnimation().
A_* operator-> | ( | ) | const |
Alias for GetAnimation.
References basic_Instance< A_ >::GetAnimation().
basic_Instance& operator= | ( | A_ & | instance | ) |
Move assignment, owns the assigned object as CreateAnimation returns objects that needs to be owned.
References basic_Instance< A_ >::Remove().
basic_Instance& operator= | ( | basic_Instance< A_ > && | other | ) |
Move assignment.
References basic_Instance< A_ >::Remove().
|
delete |
Copy assignment.
A_* Release | ( | ) |
Removes the animation from the storage without destroying it.
References basic_Instance< A_ >::Remove().
void Remove | ( | ) |
Removes the animation stored in the container, if the container owns the animation, it will be destroyed.
Use Release to release resource without destroying it
void SetAnimation | ( | A_ & | value, |
bool | owner = true |
||
) |
Sets the animation stored in this container.
References basic_Instance< A_ >::Remove().