Gorgon Game Engine
basic_LineProvider< A_ > Class Template Reference

This class allows instancing of a line like image that is made out of three parts. More...

Inheritance diagram for basic_LineProvider< A_ >:
[legend]

Public Types

using AnimationType = Line
 
- Public Types inherited from RectangularAnimationProvider
using AnimationType = RectangularAnimation
 
- Public Types inherited from AnimationProvider
using AnimationType = Animation
 
- Public Types inherited from Provider
using AnimationType = Base
 

Public Member Functions

 basic_LineProvider (basic_LineProvider &&other)
 Move constructor. More...
 
 basic_LineProvider (const basic_LineProvider &)=delete
 
 basic_LineProvider (Orientation orientation, A_ &&start, A_ &&middle, A_ &&end)
 Filling constructor. This variant will move in the animations, freeing them with this item. More...
 
 basic_LineProvider (Orientation orientation, A_ &start, A_ &middle, A_ &end)
 Filling constructor. More...
 
 basic_LineProvider (Orientation orientation, A_ *start, A_ *middle, A_ *end)
 Filling constructor, nullptr is acceptable, however, it is not advised to use only one side, that is a waste of resources, a regular image can also be tiled or stretched to fit to an area. More...
 
 basic_LineProvider (Orientation orientation=Orientation::Horizontal)
 Empty constructor, line can be instanced even if it is completely empty. More...
 
 ~basic_LineProvider ()
 
LineCreateAnimation (bool create=true) const override
 This function should create and animation and depending on the create parameter, it should create its own timer. More...
 
LineCreateAnimation (Gorgon::Animation::ControllerBase &timer) const override
 This function should create a new animation with the given controller and if owner parameter is set to true, it should assume ownership of the controller. More...
 
virtual RectangularAnimationCreateEnd () const override
 Creates a start animation without controller. This function should always return an animation. More...
 
virtual RectangularAnimationCreateMiddle () const override
 Creates a start animation without controller. This function should always return an animation. More...
 
virtual RectangularAnimationCreateStart () const override
 Creates a start animation without controller. This function should always return an animation. More...
 
A_ * GetEnd () const
 Returns the end animation, might return nullptr. More...
 
A_ * GetMiddle () const
 Returns the middle animation, might return nullptr. More...
 
Geometry::Size GetSize () const override
 
A_ * GetStart () const
 Returns the start animation, might return nullptr. More...
 
virtual auto MoveOutProvider () -> decltype(*this) override
 This function moves this animation provider into a new provider. More...
 
void OwnProviders ()
 Issuing this function will make this line to own its providers destroying them along with itself. More...
 
void Prepare ()
 Prepares all animation providers if the they support Prepare function. More...
 
void ReleaseProviders ()
 Issuing this function will make this line to disown its providers and set them to nullptr. More...
 
void SetEnd (A_ *value)
 Changes the end animation, ownership semantics will not change. More...
 
void SetMiddle (A_ *value)
 Changes the middle animation, ownership semantics will not change. More...
 
void SetStart (A_ *value)
 Changes the start animation, ownership semantics will not change. More...
 
- Public Member Functions inherited from ILineProvider
 ILineProvider (Orientation orientation)
 
virtual Orientation GetOrientation () const
 Returns the orientation of the line provider. More...
 
virtual bool GetTiling () const
 Returns if the middle part will be tiled. More...
 
virtual void SetOrientation (Orientation value)
 Changes the orientation of the provider. More...
 
virtual void SetTiling (bool value)
 Sets whether the middle part would be tiled. More...
 
- Public Member Functions inherited from RectangularAnimationProvider
int GetHeight () const
 
int GetWidth () const
 
- Public Member Functions inherited from AnimationProvider
virtual ~AnimationProvider ()
 
- Public Member Functions inherited from Provider
virtual ~Provider ()
 Virtual destructor. More...
 

Detailed Description

template<class A_>
class Gorgon::Graphics::basic_LineProvider< A_ >

This class allows instancing of a line like image that is made out of three parts.

The first part is the start of the line, the second part is the middle and the third part is the end of the line. Middle part can be repeated or stretched. A line provider can have empty animations. Provider will use EmptyImage for missing parts. A_ must derive from RectangularAnimationProvider. For best results, try to keep height of parts same for horizontal, widths same for vertical lines.

Member Typedef Documentation

◆ AnimationType

Constructor & Destructor Documentation

◆ basic_LineProvider() [1/6]

Empty constructor, line can be instanced even if it is completely empty.

◆ basic_LineProvider() [2/6]

basic_LineProvider ( Orientation  orientation,
A_ &  start,
A_ &  middle,
A_ &  end 
)

Filling constructor.

References Gorgon::end().

◆ basic_LineProvider() [3/6]

basic_LineProvider ( Orientation  orientation,
A_ &&  start,
A_ &&  middle,
A_ &&  end 
)

Filling constructor. This variant will move in the animations, freeing them with this item.

◆ basic_LineProvider() [4/6]

basic_LineProvider ( Orientation  orientation,
A_ *  start,
A_ *  middle,
A_ *  end 
)

Filling constructor, nullptr is acceptable, however, it is not advised to use only one side, that is a waste of resources, a regular image can also be tiled or stretched to fit to an area.


References Gorgon::end().

◆ basic_LineProvider() [5/6]

Move constructor.

References ILineProvider::SetTiling().

◆ basic_LineProvider() [6/6]

basic_LineProvider ( const basic_LineProvider< A_ > &  )
delete

◆ ~basic_LineProvider()

Member Function Documentation

◆ CreateAnimation() [1/2]

Line& CreateAnimation ( bool  create = true) const
overridevirtual

This function should create and animation and depending on the create parameter, it should create its own timer.

Implements RectangularAnimationProvider.

References Gorgon::Resource::GID::Line.

◆ CreateAnimation() [2/2]

Line& CreateAnimation ( Gorgon::Animation::ControllerBase timer) const
overridevirtual

This function should create a new animation with the given controller and if owner parameter is set to true, it should assume ownership of the controller.

Implements RectangularAnimationProvider.

References Gorgon::Resource::GID::Line.

◆ CreateEnd()

virtual RectangularAnimation& CreateEnd ( ) const
overridevirtual

Creates a start animation without controller. This function should always return an animation.

Implements ILineProvider.

References EmptyImage::Instance().

◆ CreateMiddle()

virtual RectangularAnimation& CreateMiddle ( ) const
overridevirtual

Creates a start animation without controller. This function should always return an animation.

Implements ILineProvider.

References EmptyImage::Instance().

◆ CreateStart()

virtual RectangularAnimation& CreateStart ( ) const
overridevirtual

Creates a start animation without controller. This function should always return an animation.

Implements ILineProvider.

References EmptyImage::Instance().

◆ GetEnd()

A_* GetEnd ( ) const

Returns the end animation, might return nullptr.

◆ GetMiddle()

A_* GetMiddle ( ) const

Returns the middle animation, might return nullptr.

◆ GetSize()

Geometry::Size GetSize ( ) const
overridevirtual

◆ GetStart()

A_* GetStart ( ) const

Returns the start animation, might return nullptr.

◆ MoveOutProvider()

virtual auto MoveOutProvider ( ) -> decltype(*this)
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 ILineProvider.

◆ OwnProviders()

void OwnProviders ( )

Issuing this function will make this line to own its providers destroying them along with itself.

◆ Prepare()

void Prepare ( )

Prepares all animation providers if the they support Prepare function.

◆ ReleaseProviders()

void ReleaseProviders ( )

Issuing this function will make this line to disown its providers and set them to nullptr.

◆ SetEnd()

void SetEnd ( A_ *  value)

Changes the end animation, ownership semantics will not change.

◆ SetMiddle()

void SetMiddle ( A_ *  value)

Changes the middle animation, ownership semantics will not change.

◆ SetStart()

void SetStart ( A_ *  value)

Changes the start animation, ownership semantics will not change.


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