Gorgon Game Engine
DiscreteProvider Class Referenceabstract

Provides a discreet animation that is made out of frames. More...

Inheritance diagram for DiscreteProvider:
[legend]

Public Member Functions

virtual void Add (const Frame &frame)=0
 Adds a frame to the end of the animation. More...
 
virtual void Clear ()=0
 Clears all frames from this animation. More...
 
virtual const FrameFrameAt (int index) const =0
 Returns the frame at specific point. More...
 
virtual int GetCount () const =0
 Returns number of frames. More...
 
virtual unsigned GetDuration () const =0
 Returns the duration of the animation. More...
 
virtual unsigned GetDuration (unsigned frame) const =0
 Returns the duration of the given frame. More...
 
virtual void Insert (const Frame &frame, int before)=0
 Adds a frame to the specified point the animation. More...
 
virtual void MoveBefore (unsigned index, int before)=0
 Moves the frame with the given index to the specified point the animation. More...
 
const Frameoperator[] (int index) const
 Returns the frame at specific point. More...
 
virtual void Remove (unsigned index)=0
 Removes the given frame. More...
 
virtual unsigned StartOf (unsigned frame) const =0
 Returns the starting time of the given frame. More...
 
- Public Member Functions inherited from Provider
virtual ~Provider ()
 Virtual destructor. More...
 
virtual BaseCreateAnimation (bool create=true) const =0
 This function should create an animation and depending on the create parameter, it should create a timer for it. More...
 
virtual BaseCreateAnimation (ControllerBase &timer) const =0
 This function should create a new animation with the given controller. More...
 
virtual ProviderMoveOutProvider ()=0
 This function moves this animation provider into a new provider. More...
 

Additional Inherited Members

- Public Types inherited from Provider
using AnimationType = Base
 

Detailed Description

Provides a discreet animation that is made out of frames.

This is an interface and should be derived in order to be used.

Member Function Documentation

◆ Add()

virtual void Add ( const Frame frame)
pure virtual

Adds a frame to the end of the animation.

Frames are designed to be copied, thus they should be lightweight object.

Implemented in basic_StorageInjection< Graphics::DiscreteAnimationProvider >.

◆ Clear()

virtual void Clear ( )
pure virtual

Clears all frames from this animation.

Implemented in basic_StorageInjection< Graphics::DiscreteAnimationProvider >.

◆ FrameAt()

virtual const Frame& FrameAt ( int  index) const
pure virtual

Returns the frame at specific point.

Implemented in basic_StorageInjection< Graphics::DiscreteAnimationProvider >.

◆ GetCount()

virtual int GetCount ( ) const
pure virtual

Returns number of frames.

Implemented in basic_StorageInjection< Graphics::DiscreteAnimationProvider >.

◆ GetDuration() [1/2]

virtual unsigned GetDuration ( ) const
pure virtual

Returns the duration of the animation.

Implemented in basic_StorageInjection< Graphics::DiscreteAnimationProvider >.

◆ GetDuration() [2/2]

virtual unsigned GetDuration ( unsigned  frame) const
pure virtual

Returns the duration of the given frame.

Implemented in basic_StorageInjection< Graphics::DiscreteAnimationProvider >.

◆ Insert()

virtual void Insert ( const Frame frame,
int  before 
)
pure virtual

Adds a frame to the specified point the animation.

Frames are designed to be copied, thus they should be lightweight object. Before is the index of the frame that this frame will be placed before. If it is greater or equal to the number of frames, this function will act like add. Additionally, before could be negative, denoting it will start from the end. -1 is before the last item.

Implemented in basic_StorageInjection< Graphics::DiscreteAnimationProvider >.

◆ MoveBefore()

virtual void MoveBefore ( unsigned  index,
int  before 
)
pure virtual

Moves the frame with the given index to the specified point the animation.

Before is the index of the frame that this frame will be placed before. If it is greater or equal to the number of frames, this function will move the item to the end. Additionally, before could be negative, denoting it will start from the end. -1 is before the last item.

Implemented in basic_StorageInjection< Graphics::DiscreteAnimationProvider >.

◆ operator[]()

const Frame& operator[] ( int  index) const

Returns the frame at specific point.

References DiscreteProvider::FrameAt().

◆ Remove()

virtual void Remove ( unsigned  index)
pure virtual

Removes the given frame.

Implemented in basic_StorageInjection< Graphics::DiscreteAnimationProvider >.

◆ StartOf()

virtual unsigned StartOf ( unsigned  frame) const
pure virtual

Returns the starting time of the given frame.

Implemented in basic_StorageInjection< Graphics::DiscreteAnimationProvider >.


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