<commit_before>#include "Input.h"

#include <cassert>
#include <fstream>
#include <iostream>
#include <stdexcept>

#include "RawInputHandler.h"

#include "common/Modification.h"
#include "window/Window.h"

#include "Stranded.h"

#include "common/ParseUtils.h"
#include "common/StringUtils.h"

const std::string Input::keyNameInfoPath = "sys/keys.inf";
const std::string Input::defaultName = "null";

Input::Input(Window& window) :
	window(window),
	mouseButtonNames(6, defaultName),
	mouseWheelUpName(defaultName),
	mouseWheelDownName(defaultName),
	keyNames(256, defaultName),
	rawInputHandlers()
{}

Input::~Input()
{}

bool Input::init(const Modification& modification)
{
	if (!loadKeyNames(modification.getPath()))
	{
		return false;
	}

	window.registerInput(this);

	return true;
}

void Input::update(float deltaTime)
{
	window.pollEvents();
}

std::string Input::getMouseButtonName(uint8_t button) const
{
	if (button >= mouseButtonNames.size())
	{
		return defaultName;
	}

	return mouseButtonNames[button];
}

std::string Input::getMouseWheelUpName() const<commit_msg>Fixed compilation warnigs in Input.cpp<commit_after>#include "Input.h"

#include <cassert>
#include <fstream>
#include <iostream>
#include <stdexcept>

#include "RawInputHandler.h"

#include "common/Modification.h"
#include "window/Window.h"

#include "Stranded.h"

#include "common/ParseUtils.h"
#include "common/StringUtils.h"

const std::string Input::keyNameInfoPath = "sys/keys.inf";
const std::string Input::defaultName = "null";

Input::Input(Window& window) :
	window(window),
	mouseButtonNames(6, defaultName),
	mouseWheelUpName(defaultName),
	mouseWheelDownName(defaultName),
	keyNames(256, defaultName),
	rawInputHandlers()
{}

Input::~Input()
{}

bool Input::init(const Modification& modification)
{
	if (!loadKeyNames(modification.getPath()))
	{
		return false;
	}

	window.registerInput(this);

	return true;
}

void Input::update(float)
{
	window.pollEvents();
}

std::string Input::getMouseButtonName(uint8_t button) const
{
	if (button >= mouseButtonNames.size())
	{
		return defaultName;
	}

	return mouseButtonNames[button];
}

std::string Input::getMouseWheelUpName() const
{'fraction_non_alphanumeric': 0.14693689543988944, 'fraction_numerical': 0.004606172270842929, 'mean_word_length': 6.78494623655914, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '6681742', 'n_tokens_mistral': 760, 'n_tokens_neox': 747, 'n_words': 142}