8#ifndef W_POSITION_COMPONENT_HPP
9#define W_POSITION_COMPONENT_HPP
13#pragma GCC diagnostic push
14#pragma GCC diagnostic ignored "-Wfloat-equal"
15#pragma GCC diagnostic ignored "-Wswitch-default"
16#include <SFML/Graphics.hpp>
17#pragma GCC diagnostic pop
81 void move(
const sf::Vector2f& offset );
88 sf::Vector2f mPosition;
89 sf::Vector2f mLastPosition;
Component()
Protected constructor to restrict instantiation to derived classes.
Definition wComponent.cpp:17
void move(const sf::Vector2f &offset)
Moves the position by an offset.
Definition wPositionComponent.cpp:52
void setPosition(sf::Vector2f newPosition)
Sets the 2D position to a new value.
Definition wPositionComponent.cpp:40
sf::Vector2f getPosition() const
Gets the current position of the component.
Definition wPositionComponent.cpp:30
void debugPrint() const
Outputs the position (x, y) to standard output for debugging.
Definition wPositionComponent.cpp:64
virtual ~PositionComponent()=default
sf::Vector2f getLastPosition() const
Returns the previous position (before the last move).
Definition wPositionComponent.cpp:35
PositionComponent(sf::Vector2f position=sf::Vector2f(0.0f, 0.0f))
Constructs a PositionComponent with the given position.
Definition wPositionComponent.cpp:17
Definition wColorComponent.cpp:9