21#include <SFML/Graphics/Texture.hpp>
22#include <SFML/Graphics/CircleShape.hpp>
23#include <SFML/Graphics/ConvexShape.hpp>
24#include <SFML/Graphics/RectangleShape.hpp>
179 void setShape(
const std::size_t pointCount);
188 void setShape(
const std::size_t pointCount,
const float radius);
196 void setShape(
const std::pair<float, float> &size);
225 void setShape(
const std::pair<GUI::ECS::Systems::ActiveShape, std::any> &shape);
239 void setPosition(
const std::pair<float, float> position);
245 void setDimension(
const std::pair<float, float> dimension);
258 void setName(
const std::string &name);
304 const std::pair<GUI::ECS::Systems::ActiveShape, std::any>
getActiveShape()
const;
342 const std::pair<GUI::ECS::Systems::ActiveShape, std::any>
getShape()
const;
356 const std::string
getName()
const;
372 const std::string
getInfo(
const unsigned int indent = 0)
const;
410 std::optional<std::pair<GUI::ECS::Systems::ActiveShape, std::any>>
render()
const;
426 void _processColor();
431 void _processCollisions();
441 template <
typename T>
442 void _assignShape(
const std::any &shape, std::optional<T> &shapeStorage);
444 bool _visible =
true;
445 bool _inConstructor =
true;
448 std::optional<sf::CircleShape> _sfShapeCircle;
449 std::optional<sf::ConvexShape> _sfShapeConvex;
450 std::optional<sf::RectangleShape> _sfShapeRectangle;
452 std::string _name =
"";
453 std::string _application =
"";
File in charge of containing the active shape enum the one in charge of tracking the type of shape st...
File in charge of containing the custom errors that are going to be used for custom description error...
This is the file that links the EntityNode children.
Macro definitions for logging messages with varying levels of detail and formatting.
This is the file in charge of containing the Log class (the one in charge of outputing info only when...
This is the header file containing the class for the mouse information.
Manages shapes and their associated properties in the ECS framework.
const bool isVisible() const
Get the visibility status of the component.
void setCollision(const GUI::ECS::Systems::Collision &collision)
Set the internal collision class using another Collision component.
void setName(const std::string &name)
Set the Name of the component.
void setClickedColor(const GUI::ECS::Systems::Colour &clickedColor)
Sets the clicked color for the shape.
const bool isShapeInitialised() const
Know if there is a shape initialised or not.
const std::string getInfo(const unsigned int indent=0) const
This is a function meant for debugging purposes It will dump the current state of the variables upon ...
const std::string getName() const
Get the Name of the component.
const GUI::ECS::Systems::Colour getHoverColor() const
Get the Hover Color of the shape.
std::optional< std::pair< GUI::ECS::Systems::ActiveShape, std::any > > render() const
Get an optional std::pair of the object so that it can be displayed on screen.
const std::pair< GUI::ECS::Systems::ActiveShape, std::any > getActiveShape() const
Get the Active Shape and it's type all contained in an std::pair.
void setShape(const std::size_t pointCount)
Create a convex shape.
const std::pair< float, float > getDimension() const
Get the Dimension of the shape.
const bool getVisible() const
Get the info about if the shape is visible or not.
const GUI::ECS::Systems::Colour getNormalColor() const
Get the Normal Color of the shape.
ShapeComponent & operator=(const ShapeComponent ©)
'=' operator in charge of allowing the user to seamlessly assing the content of one ShapeComponent to...
void update(const GUI::ECS::Systems::MouseInfo &mouse)
Update the mouse information of the component (this is used for mouse collision calculations)
void setDimension(const std::pair< float, float > dimension)
Set the Dimension object.
const std::string getApplication() const
Get the Application context of the component.
const GUI::ECS::Systems::ActiveShape getShapeType() const
Get the Shape Type shape, none is returned if none are initialised.
const GUI::ECS::Systems::Collision getCollision() const
Get the Collision Component of the object.
const std::string getShapeTypeString() const
Get the Shape Type shape, none is returned if none are initialised.
void setHoverColor(const GUI::ECS::Systems::Colour &hoverColor)
Sets the hover color for the shape.
void clearShapes()
Remove all and any initialised shapes in the class, this will reset the type to NONE.
ShapeComponent(const std::uint32_t entityId=0)
Default constructor.
void setVisible(const bool visible)
Set the visible toggle informing the program if it should (or not) render the component.
void toggleVisibility()
Toggles the visibility of the shape.
~ShapeComponent()
Destructor.
const std::pair< GUI::ECS::Systems::ActiveShape, std::any > getShape() const
Get the Shape and it's type all packaged in an std::pair.
const GUI::ECS::Systems::Colour getClickedColor() const
Get the Clicked Color shape.
void setNormalColor(const GUI::ECS::Systems::Colour &normalColor)
Sets the normal color for the shape.
void setPosition(const std::pair< float, float > position)
Set the position of the component.
void setApplication(const std::string &application)
Set the Application context of the component.
const std::pair< float, float > getPosition() const
Get the Position of the shape.
Represents a rectangular component that can detect collisions and mouse interactions,...
A class for representing and manipulating colors using RGBA components. Inherits from EntityNode to a...
static const Colour White
static const Colour AliceBlue
static const Colour CornflowerBlue
A generic 2D rectangle class that holds position and size as pairs.
std::ostream & operator<<(std::ostream &os, const AnimationComponent &item)
Outputs the animation's info to a stream.
ActiveShape
Enum representing different types of shapes managed by the ShapeComponent.