![]() |
Gorgon Game Engine
|
This class stores animations as a part of itself so that it can be moved around as a value rather than a reference. More...
Public Member Functions | |
| basic_Storage ()=default | |
| Empty constructor. More... | |
| basic_Storage (A_ &anim, bool owner=false) | |
| Filling constructor. More... | |
| basic_Storage (basic_Storage &&other) | |
| Move constructor. More... | |
| basic_Storage (const basic_Storage &)=delete | |
| Copy constructor is disabled for ownership reasons. More... | |
| virtual A_::AnimationType & | CreateAnimation (bool create=true) const override |
| This function creates a new animation from the stored animation provider. More... | |
| virtual A_::AnimationType & | CreateAnimation (ControllerBase &timer) const override |
| This function creates a new animation from the stored animation provider. More... | |
| A_ & | GetAnimation () const |
| Returns the animation stored in the object. More... | |
| bool | HasAnimation () const |
| Check if this storage has an animation. More... | |
| bool | IsOwner () const |
| Whether the stored animation is owned by this container. More... | |
| virtual auto | MoveOutProvider () -> decltype(*this) override |
| This function moves this animation provider into a new provider. More... | |
| A_ & | operator* () const |
| Alias for GetAnimation. More... | |
| A_ * | operator-> () const |
| Alias for GetAnimation. More... | |
| basic_Storage & | operator= (basic_Storage &&other) |
| Move assignment. More... | |
| basic_Storage & | operator= (const basic_Storage &)=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) |
| Sets the animation stored in this container. More... | |
| void | SetAnimation (A_ &value, bool owner=false) |
| Sets the animation stored in this container. More... | |
Public Member Functions inherited from Provider | |
| virtual | ~Provider () |
| Virtual destructor. More... | |
Additional Inherited Members | |
Public Types inherited from Provider | |
| using | AnimationType = Base |
This class stores animations as a part of itself so that it can be moved around as a value rather than a reference.
|
default |
Empty constructor.
| basic_Storage | ( | A_ & | anim, |
| bool | owner = false |
||
| ) |
Filling constructor.
|
delete |
Copy constructor is disabled for ownership reasons.
| basic_Storage | ( | basic_Storage< A_ > && | other | ) |
Move constructor.
|
overridevirtual |
This function creates a new animation from the stored animation provider.
If there is no animation provider stored, it will throw std::runtime_error
Implements Provider.
|
overridevirtual |
This function creates a new animation from the stored animation provider.
If there is no animation provider stored, it will throw std::runtime_error
Implements Provider.
| 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 storage has an animation.
| bool IsOwner | ( | ) | const |
Whether the stored animation is owned by this container.
|
overridevirtual |
This function moves this animation provider into a new provider.
Ownership of this new object belongs to the caller and this object could be destroyed safely.
Implements Provider.
References basic_Storage< A_ >::basic_Storage().
| A_& operator* | ( | ) | const |
Alias for GetAnimation.
References basic_Storage< A_ >::GetAnimation().
| A_* operator-> | ( | ) | const |
Alias for GetAnimation.
References basic_Storage< A_ >::GetAnimation().
| basic_Storage& operator= | ( | basic_Storage< A_ > && | other | ) |
Move assignment.
References basic_Storage< A_ >::Remove().
|
delete |
Copy assignment.
| A_* Release | ( | ) |
Removes the animation from the storage without destroying it.
References basic_Storage< 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 | ) |
Sets the animation stored in this container.
References basic_Storage< A_ >::Remove().
| void SetAnimation | ( | A_ & | value, |
| bool | owner = false |
||
| ) |
Sets the animation stored in this container.
References basic_Storage< A_ >::Remove().