Gorgon Game Engine
Line Class Reference

This is a line resource, it stores a Graphics::LineProvider. More...

Inheritance diagram for Line:
[legend]

Public Member Functions

 Line ()
 Creates a new empty line. More...
 
 Line (Graphics::AnimatedBitmapLineProvider &&prov)
 Creates a new line using another line provider. More...
 
 Line (Graphics::AnimatedBitmapLineProvider &prov)
 Creates a new line using another line provider. More...
 
 Line (Graphics::BitmapLineProvider &&prov)
 Creates a new line using another line provider. More...
 
 Line (Graphics::BitmapLineProvider &prov)
 Creates a new line using another line provider. More...
 
 Line (Graphics::LineProvider &&prov)
 Creates a new line using another line provider. More...
 
 Line (Graphics::LineProvider &prov)
 Creates a new line using another line provider. More...
 
void AssumeProvider (Graphics::AnimatedBitmapLineProvider &value)
 Changes the provider stored in this line, ownership will be transferred. More...
 
void AssumeProvider (Graphics::BitmapLineProvider &value)
 Changes the provider stored in this line, ownership will be transferred. More...
 
void AssumeProvider (Graphics::LineProvider &value)
 Changes the provider stored in this line, ownership will be transferred. More...
 
virtual Gorgon::Graphics::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...
 
virtual Gorgon::Graphics::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 Graphics::RectangularAnimationCreateEnd () const override
 Creates a start animation without controller. This function should always return an animation. More...
 
virtual Graphics::RectangularAnimationCreateMiddle () const override
 Creates a start animation without controller. This function should always return an animation. More...
 
virtual Graphics::RectangularAnimationCreateStart () const override
 Creates a start animation without controller. This function should always return an animation. More...
 
GID::Type GetGID () const override
 This function shall return Gorgon ID of this resource. More...
 
virtual Graphics::Orientation GetOrientation () const override
 Returns the orientation of the line provider. More...
 
virtual Geometry::Size GetSize () const override
 
virtual bool GetTiling () const override
 Returns if the middle part will be tiled. More...
 
ILineProviderMoveOutProvider () override
 This function moves this animation provider into a new provider. More...
 
void RemoveProvider ()
 Removes the provider, if it is owned by this resource it will be deleted. More...
 
virtual void SetOrientation (Graphics::Orientation value) override
 Changes the orientation of the provider. More...
 
void SetProvider (Graphics::AnimatedBitmapLineProvider &value)
 Changes the provider stored in this line, ownership will not be transferred. More...
 
void SetProvider (Graphics::BitmapLineProvider &value)
 Changes the provider stored in this line, ownership will not be transferred. More...
 
void SetProvider (Graphics::LineProvider &value)
 Changes the provider stored in this line, ownership will not be transferred. More...
 
virtual void SetTiling (bool value) override
 Sets whether the middle part would be tiled. More...
 
- Public Member Functions inherited from ILineProvider
 ILineProvider (Orientation orientation)
 
- 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...
 
- Public Member Functions inherited from AnimationStorage
Graphics::RectangularAnimationStorage MoveOut ()
 Moves this animation out as a generic value type animation. More...
 
- Public Member Functions inherited from Base
 Base ()
 Default constructor. More...
 
const Containers::Collection< Base >::ConstIterator begin () const
 Allows easy iteration through range based fors. More...
 
const Containers::Collection< Base >::ConstIterator cbegin () const
 Beginning of children. More...
 
const Containers::Collection< Base >::ConstIterator cend () const
 End of children. More...
 
bool DeleteResource ()
 Safely deletes the resource. More...
 
virtual void Discard ()
 This function shall discard any transitional data which is not vital after Prepare function is issued. More...
 
const Containers::Collection< Base >::ConstIterator end () const
 Allows easy iteration through range based fors. More...
 
virtual SGuid GetGuid () const
 Returns the guid of the object. More...
 
const std::string & GetName () const
 Returns the name of this object. More...
 
BaseGetParent () const
 Returns the parent. If no parent set, this function throws std::runtime_error. More...
 
BaseGetParentPtr () const
 Returns the pointer to the parent. This function may return nullptr. More...
 
const BaseGetRoot () const
 Returns the root of this resource. More...
 
bool HasParent () const
 Returns whether this object has a parent. More...
 
virtual bool IsEqual (const SGuid &guid) const
 This function tests whether this object has the given SGuid. More...
 
virtual void Prepare ()
 This function shall prepare this resource to be used after resource is loaded. More...
 
virtual void Resolve (File &file)
 This function shall resolve links or similar constructs. More...
 
void Save (Writer &writer)
 Saves this object into the given writer. The writer should be open prior to this call. More...
 
virtual void SetGuid (SGuid guid)
 Changes the guid of the object. More...
 
virtual void SetName (const std::string &name)
 Sets the name of the object. More...
 

Static Public Member Functions

static LineLoadResource (std::weak_ptr< File > file, std::shared_ptr< Reader > reader, unsigned long size)
 This function loads a line resource from the file. More...
 
static void SaveThis (Writer &writer, const Graphics::ILineProvider &provider)
 

Protected Member Functions

virtual Graphics::RectangularAnimationStorage animmoveout () override
 
void save (Writer &writer) const override
 
- Protected Member Functions inherited from Base
virtual ~Base ()
 Destructor, Always children gets destroyed first. More...
 
void destroychildren ()
 Destroys the children of this resource. More...
 
void setparenttonullptr (Base &base)
 Sets the parent of an object to nullptr, provides access. More...
 

Additional Inherited Members

- 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 Attributes inherited from Base
const Containers::Collection< Base > & Children
 The children this object have. More...
 
unsigned long refcount
 INTERNAL, Reference count, used in linking mechanism. More...
 
- Protected Attributes inherited from Base
Containers::Collection< Basechildren
 Child objects that this resource object have. More...
 
SGuid guid
 SGuid to identify this resource object. More...
 
std::string name
 Name of this resource object, may not be loaded. More...
 
Baseparent
 Immediate parent of this resource. More...
 
const Baseroot
 Root of this resource. More...
 

Detailed Description

This is a line resource, it stores a Graphics::LineProvider.

This resource can work with Graphics::LineProvider, Graphics::BitmapLineProvider and Graphics::AnimatedBitmapLineProvider.

See also
Gorgon::Graphics::basic_LineProvider for details

Constructor & Destructor Documentation

◆ Line() [1/7]

Line ( Graphics::BitmapLineProvider prov)
explicit

Creates a new line using another line provider.

◆ Line() [2/7]

Creates a new line using another line provider.

◆ Line() [3/7]

Line ( Graphics::LineProvider prov)
explicit

Creates a new line using another line provider.

◆ Line() [4/7]

Line ( Graphics::BitmapLineProvider &&  prov)
explicit

Creates a new line using another line provider.

◆ Line() [5/7]

Creates a new line using another line provider.

◆ Line() [6/7]

Line ( Graphics::LineProvider &&  prov)
explicit

Creates a new line using another line provider.

◆ Line() [7/7]

Line ( )

Creates a new empty line.

Member Function Documentation

◆ animmoveout()

Graphics::RectangularAnimationStorage animmoveout ( )
overrideprotectedvirtual

Implements AnimationStorage.

References Line::MoveOutProvider().

◆ AssumeProvider() [1/3]

void AssumeProvider ( Graphics::AnimatedBitmapLineProvider value)

Changes the provider stored in this line, ownership will be transferred.

References Line::RemoveProvider().

◆ AssumeProvider() [2/3]

void AssumeProvider ( Graphics::BitmapLineProvider value)

Changes the provider stored in this line, ownership will be transferred.

References Line::RemoveProvider().

◆ AssumeProvider() [3/3]

void AssumeProvider ( Graphics::LineProvider value)

Changes the provider stored in this line, ownership will be transferred.

References Line::RemoveProvider().

◆ CreateAnimation() [1/2]

virtual Gorgon::Graphics::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 basic_LineProvider< A_ >::CreateAnimation().

◆ CreateAnimation() [2/2]

virtual Gorgon::Graphics::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 basic_LineProvider< A_ >::CreateAnimation().

◆ CreateEnd()

virtual Graphics::RectangularAnimation& CreateEnd ( ) const
overridevirtual

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

Implements ILineProvider.

References basic_LineProvider< A_ >::CreateEnd().

◆ CreateMiddle()

virtual Graphics::RectangularAnimation& CreateMiddle ( ) const
overridevirtual

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

Implements ILineProvider.

References basic_LineProvider< A_ >::CreateMiddle().

◆ CreateStart()

virtual Graphics::RectangularAnimation& CreateStart ( ) const
overridevirtual

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

Implements ILineProvider.

References basic_LineProvider< A_ >::CreateStart().

◆ GetGID()

GID::Type GetGID ( ) const
overridevirtual

This function shall return Gorgon ID of this resource.

Implements Base.

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

◆ GetOrientation()

virtual Graphics::Orientation GetOrientation ( ) const
overridevirtual

Returns the orientation of the line provider.

Reimplemented from ILineProvider.

References ILineProvider::GetOrientation().

◆ GetSize()

virtual Geometry::Size GetSize ( ) const
overridevirtual

◆ GetTiling()

virtual bool GetTiling ( ) const
overridevirtual

Returns if the middle part will be tiled.

Reimplemented from ILineProvider.

References ILineProvider::GetTiling().

◆ LoadResource()

Line * LoadResource ( std::weak_ptr< File file,
std::shared_ptr< Reader reader,
unsigned long  size 
)
static

This function loads a line resource from the file.

References Line::Line().

◆ MoveOutProvider()

Graphics::ILineProvider & MoveOutProvider ( )
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.

References ILineProvider::ILineProvider(), and Base::children.

◆ RemoveProvider()

void RemoveProvider ( )

Removes the provider, if it is owned by this resource it will be deleted.

◆ save()

void save ( Writer writer) const
overrideprotectedvirtual

Implements Base.

References Writer::WriteEnd(), and Writer::WriteObjectStart().

◆ SaveThis()

void SaveThis ( Writer writer,
const Graphics::ILineProvider provider 
)
static

◆ SetOrientation()

virtual void SetOrientation ( Graphics::Orientation  value)
overridevirtual

Changes the orientation of the provider.

Instances will require redrawing before this change is reflected.

Reimplemented from ILineProvider.

References ILineProvider::SetOrientation().

◆ SetProvider() [1/3]

void SetProvider ( Graphics::AnimatedBitmapLineProvider value)

Changes the provider stored in this line, ownership will not be transferred.

References Line::RemoveProvider().

◆ SetProvider() [2/3]

void SetProvider ( Graphics::BitmapLineProvider value)

Changes the provider stored in this line, ownership will not be transferred.

References Line::RemoveProvider().

◆ SetProvider() [3/3]

void SetProvider ( Graphics::LineProvider value)

Changes the provider stored in this line, ownership will not be transferred.

References Line::RemoveProvider().

◆ SetTiling()

virtual void SetTiling ( bool  value)
overridevirtual

Sets whether the middle part would be tiled.

If set to false it will be stretched to fit the given area. Instances will require redrawing before this change is reflected. Tiling is recommended for all applications.

Reimplemented from ILineProvider.

References ILineProvider::SetTiling().


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