 |
Gorgon Game Engine
|
Go to the documentation of this file.
4 #include "../Graphics/Rectangle.h"
7 namespace Gorgon {
namespace Resource {
96 throw std::runtime_error(
"Provider is not set.");
103 throw std::runtime_error(
"Provider is not set.");
110 throw std::runtime_error(
"Provider is not set.");
117 throw std::runtime_error(
"Provider is not set.");
124 throw std::runtime_error(
"Provider is not set.");
131 throw std::runtime_error(
"Provider is not set.");
138 throw std::runtime_error(
"Provider is not set.");
145 throw std::runtime_error(
"Provider is not set.");
152 throw std::runtime_error(
"Provider is not set.");
159 throw std::runtime_error(
"Provider is not set.");
166 throw std::runtime_error(
"Provider is not set.");
173 throw std::runtime_error(
"Provider is not set.");
180 throw std::runtime_error(
"Provider is not set.");
187 throw std::runtime_error(
"Provider is not set.");
194 throw std::runtime_error(
"Provider is not set.");
201 throw std::runtime_error(
"Provider is not set.");
207 static Rectangle *
LoadResource(std::weak_ptr<File> file, std::shared_ptr<Reader> reader,
unsigned long size);
virtual RectangularAnimation & CreateMM() const override
Creates an animation without controller. This function should always return an animation.
Definition: Rectangle.h:360
This class stores animations as a part of itself so that it can be moved around as a value rather tha...
Definition: Storage.h:21
Rectangle(Graphics::AnimatedBitmapRectangleProvider &&prov)
Creates a new rectangle using another rectangle provider.
Definition: Rectangle.h:28
Rectangle(Graphics::RectangleProvider &&prov)
Creates a new rectangle using another rectangle provider.
Definition: Rectangle.h:32
constexpr Type File
File.
Definition: GID.h:84
virtual RectangularAnimation & CreateML() const override
Creates an animation without controller. This function should always return an animation.
Definition: Rectangle.h:352
Rectangle(Graphics::BitmapRectangleProvider &&prov)
Creates a new rectangle using another rectangle provider.
Definition: Rectangle.h:23
virtual bool GetSideTiling() const
Returns if the middle part will be tiled.
Definition: Rectangle.h:65
virtual void SetSideTiling(bool value) override
Sets whether the side parts (tm, ml, mr, bm) would be tiled.
Definition: Rectangle.h:171
virtual Graphics::RectangularAnimation & CreateML() const override
Creates an animation without controller. This function should always return an animation.
Definition: Rectangle.h:115
virtual Gorgon::Graphics::Rectangle & CreateAnimation(bool create=true) const override
This function should create and animation and depending on the create parameter, it should create its...
Definition: Rectangle.h:192
virtual bool GetSideTiling() const override
Returns if the middle part will be tiled.
Definition: Rectangle.h:178
Controllers are required to progress animations.
Definition: Animation.h:65
virtual bool GetCenterTiling() const
Returns if the middle part will be tiled.
Definition: Rectangle.h:53
virtual Graphics::RectangularAnimation & CreateBL() const override
Creates an animation without controller. This function should always return an animation.
Definition: Rectangle.h:136
Rectangle()=default
Creates an empty rectangle.
virtual Graphics::RectangularAnimation & CreateTM() const override
Creates an animation without controller. This function should always return an animation.
Definition: Rectangle.h:101
Interface for RectangleProviders.
Definition: Rectangle.h:12
void SetProvider(Graphics::AnimatedBitmapRectangleProvider &value)
Changes provider to the given provider, ownership will not be transferred.
Definition: Rectangle.h:52
void AssumeProvider(Graphics::RectangleProvider &value)
Changes the provider stored in this line, ownership will be transferred.
Definition: Rectangle.h:78
void AssumeProvider(Graphics::BitmapRectangleProvider &value)
Changes the provider stored in this line, ownership will be transferred.
Definition: Rectangle.h:64
static Rectangle * LoadResource(std::weak_ptr< File > file, std::shared_ptr< Reader > reader, unsigned long size)
This function loads a rectangle resource from the file.
Definition: Rectangle.cpp:83
Geometry::Size GetSize() const override
Definition: Rectangle.h:545
Root namespace for Gorgon Game Engine.
Definition: Any.h:19
This class represents a 2D geometric size.
Definition: Size.h:23
GID::Type GetGID() const override
This function shall return Gorgon ID of this resource.
Definition: Rectangle.h:41
virtual RectangularAnimation & CreateBR() const override
Creates an animation without controller. This function should always return an animation.
Definition: Rectangle.h:392
This class denotes the resource is an image animation storage.
Definition: AnimationStorage.h:12
Rectangular drawable animation.
Definition: Animations.h:19
virtual Graphics::RectangularAnimation & CreateBM() const override
Creates an animation without controller. This function should always return an animation.
Definition: Rectangle.h:143
basic_RectangleProvider< BitmapAnimationProvider > AnimatedBitmapRectangleProvider
Definition: Rectangle.h:591
virtual Graphics::RectangularAnimation & CreateBR() const override
Creates an animation without controller. This function should always return an animation.
Definition: Rectangle.h:150
virtual Graphics::RectangularAnimation & CreateMR() const override
Creates an animation without controller. This function should always return an animation.
Definition: Rectangle.h:129
virtual void SetSideTiling(bool value)
Sets whether the side parts (tm, ml, mr, bm) would be tiled.
Definition: Rectangle.h:60
void SetProvider(Graphics::BitmapRectangleProvider &value)
Changes provider to the given provider, ownership will not be transferred.
Definition: Rectangle.h:46
void RemoveProvider()
Removes the provider, if it is own by this resource it will be deleted.
Definition: Rectangle.h:85
virtual Graphics::RectangularAnimation & CreateTR() const override
Creates an animation without controller. This function should always return an animation.
Definition: Rectangle.h:108
virtual RectangularAnimation & CreateTR() const override
Creates an animation without controller. This function should always return an animation.
Definition: Rectangle.h:344
virtual Graphics::RectangularAnimation & CreateMM() const override
Creates an animation without controller. This function should always return an animation.
Definition: Rectangle.h:122
This class allows resource objects to save their data to a stream.
Definition: Writer.h:59
Rectangle & CreateAnimation(Gorgon::Animation::ControllerBase &timer) const override
This function should create a new animation with the given controller and if owner parameter is set t...
Definition: Rectangle.h:320
Graphics::IRectangleProvider & MoveOutProvider() override
This function moves this animation provider into a new provider.
Definition: Rectangle.cpp:324
basic_RectangleProvider< RectangularAnimationProvider > RectangleProvider
Definition: Rectangle.h:588
Definition: Rectangle.h:11
virtual Graphics::RectangularAnimationStorage animmoveout() override
Definition: Rectangle.cpp:320
This class allows instancing of a rectangle like image that is made out of three parts.
Definition: Rectangle.h:185
@ Graphics
Definition: Template.h:164
constexpr Type Rectangle
Definition: GID.h:238
virtual void SetCenterTiling(bool value) override
Sets whether the middle part would be tiled.
Definition: Rectangle.h:157
void SetProvider(Graphics::RectangleProvider &value)
Changes provider to the given provider, ownership will not be transferred.
Definition: Rectangle.h:58
virtual Gorgon::Graphics::Rectangle & CreateAnimation(Gorgon::Animation::ControllerBase &timer) const override
This function should create a new animation with the given controller and if owner parameter is set t...
Definition: Rectangle.h:185
basic_RectangleProvider< Bitmap > BitmapRectangleProvider
Definition: Rectangle.h:590
IRectangleProvider()
Definition: Rectangle.h:14
virtual RectangularAnimation & CreateBM() const override
Creates an animation without controller. This function should always return an animation.
Definition: Rectangle.h:384
Type to store GID information.
Definition: GID.h:23
virtual RectangularAnimation & CreateTM() const override
Creates an animation without controller. This function should always return an animation.
Definition: Rectangle.h:336
virtual RectangularAnimation & CreateTL() const override
Creates an animation without controller. This function should always return an animation.
Definition: Rectangle.h:328
static void SaveThis(Writer &writer, const Graphics::IRectangleProvider &provider)
Definition: Rectangle.cpp:250
virtual RectangularAnimation & CreateMR() const override
Creates an animation without controller. This function should always return an animation.
Definition: Rectangle.h:368
virtual RectangularAnimation & CreateBL() const override
Creates an animation without controller. This function should always return an animation.
Definition: Rectangle.h:376
virtual Graphics::RectangularAnimation & CreateTL() const override
Creates an animation without controller. This function should always return an animation.
Definition: Rectangle.h:94
This class allows drawing a rectangle like image that is made out of nine parts.
Definition: Rectangle.h:79
virtual bool GetCenterTiling() const override
Returns if the middle part will be tiled.
Definition: Rectangle.h:164
void AssumeProvider(Graphics::AnimatedBitmapRectangleProvider &value)
Changes the provider stored in this line, ownership will be transferred.
Definition: Rectangle.h:71
virtual void SetCenterTiling(bool value)
Sets whether the middle part would be tiled.
Definition: Rectangle.h:48
void save(Writer &writer) const override
Definition: Rectangle.cpp:231
virtual Geometry::Size GetSize() const override
Definition: Rectangle.h:199