diff --git a/include/player.hpp b/include/player.hpp index ec9697b..f07e737 100644 --- a/include/player.hpp +++ b/include/player.hpp @@ -13,7 +13,7 @@ protected: /** * Calcule les forces appliquées à l'objet */ - virtual sf::Vector2f getForces(const Manager& manager, const std::vector& objects) const; + virtual sf::Vector2f getForces(const Manager& manager, const std::vector& objects) const; public: Player(float x, float y); diff --git a/src/block.cpp b/src/block.cpp index 3cd792f..6a6fc3f 100644 --- a/src/block.cpp +++ b/src/block.cpp @@ -36,11 +36,11 @@ void Block::draw(Manager& manager) { } std::unique_ptr Block::getAABB() const { - return std::unique_ptr(new sf::FloatRect( + return std::make_unique( getPosition().x - Constants::GRID / 2, getPosition().y - Constants::GRID / 2, Constants::GRID, Constants::GRID - )); + ); } unsigned int Block::getTypeId() const { diff --git a/src/player.cpp b/src/player.cpp index 6835d5f..5a897ea 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -11,7 +11,7 @@ Player::Player(float x, float y) : Object(x, y) { Player::~Player() {} -sf::Vector2f Player::getForces(const Manager& manager, const std::vector& objects) const { +sf::Vector2f Player::getForces(const Manager& manager, const std::vector& objects) const { sf::Vector2f forces = Object::getForces(manager, objects); // déplacement de la balle après appui sur les touches de direction @@ -53,11 +53,11 @@ void Player::draw(Manager& manager) { } std::unique_ptr Player::getAABB() const { - return std::unique_ptr(new sf::FloatRect( + return std::make_unique( getPosition().x - getRadius(), getPosition().y - getRadius(), 2 * getRadius(), 2 * getRadius() - )); + ); } unsigned int Player::getTypeId() const {