SFML implements functionalities that allow you to determine if two rectangles intersect. You can significantly shorten your current code:
const bool Game::isColliding(const sf::RectangleShapeRectangleShape& player, const sf::RectangleShapeRectangleShape& enemy) const
{
return player.getGlobalBounds().intersects(enemy.getGlobalBounds());
}
See more: