<commit_before>#include "playerHUD.hpp"

#include "player.hpp"

#include <sstream>

#include <SFML/Graphics/RenderWindow.hpp>

namespace aw
{
	PlayerHUD::PlayerHUD()
	{
		m_font.loadFromFile("data/fonts/visitor1.ttf");
		m_displaySpeed.setFont(m_font);
		m_displaySpeed.setColor(sf::Color::White);
		m_displaySpeed.setCharacterSize(18);
		
		m_displayGravity = m_displaySpeed;

		m_displaySpeed.setPosition(sf::Vector2f(5, 5));
		m_displayGravity.setPosition(sf::Vector2f(5, 25));
	}

	void PlayerHUD::update(const Player &player)
	{
		//static_cast<int> to avoid showing ugly floating numbers...
		std::stringstream sstr;
		sstr << "Speed: " << static_cast<int>(player.getSpeed().x);
		m_displaySpeed.setString(sstr.str());

		sstr.str("");
		sstr << "Gravity: " << static_cast<int>(player.getGravitation());
		m_displayGravity.setString(sstr.str());
	}

	void PlayerHUD::render(sf::RenderWindow &window)
	{
		window.draw(m_displaySpeed);
		window.draw(m_displayGravity);
	}
}<commit_msg>Use std::round to remove ugly float numbers<commit_after>#include "playerHUD.hpp"

#include "player.hpp"

#include <sstream>

#include <SFML/Graphics/RenderWindow.hpp>

namespace aw
{
	PlayerHUD::PlayerHUD()
	{
		m_font.loadFromFile("data/fonts/visitor1.ttf");
		m_displaySpeed.setFont(m_font);
		m_displaySpeed.setColor(sf::Color::White);
		m_displaySpeed.setCharacterSize(18);
		
		m_displayGravity = m_displaySpeed;

		m_displaySpeed.setPosition(sf::Vector2f(5, 5));
		m_displayGravity.setPosition(sf::Vector2f(5, 25));
	}

	void PlayerHUD::update(const Player &player)
	{
		//std::round to avoid showing ugly floating numbers...
		std::stringstream sstr;
		sstr << "Speed: " << std::round(player.getSpeed().x);
		m_displaySpeed.setString(sstr.str());

		sstr.str("");
		sstr << "Gravity: " << std::round(player.getGravitation());
		m_displayGravity.setString(sstr.str());
	}

	void PlayerHUD::render(sf::RenderWindow &window)
	{
		window.draw(m_displaySpeed);
		window.draw(m_displayGravity);
	}
}
{'fraction_non_alphanumeric': 0.15979899497487438, 'fraction_numerical': 0.010050251256281407, 'mean_word_length': 5.795221843003413, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1345938', 'n_tokens_mistral': 790, 'n_tokens_neox': 732, 'n_words': 102}