<commit_before>#include "menumanager.hpp"
#include "menustep.hpp"
#include <lib/core/log.hpp>
#include "menutheme.hpp"

namespace lib
{
	namespace menu
	{
		MenuManager::MenuManager(const std::string &name)
			: Scene{ name }
		{
//			_steps = stepsVector();
//			getSteps();
		}

		bool MenuManager::init()
		{
			using namespace draw;
			if (Scene::init())
			{
				m_mTheme = sptr<MenuTheme>(new MenuTheme{ Color{ 0, 0, 255 }, Color{ 255, 0, 0 }, 
					"game_menu.mainFont", 40,40});
				m_mTheme->setParent(this);
				return m_mTheme->init();
			}
			return false;
		}

		MenuManager::~MenuManager()
		{
		}

		void MenuManager::addMenuStep(sptr<MenuStep> step)
		{
			addRenderGroup(step);
		}

		void MenuManager::start(sptr<MenuStep> firstStep)
		{
			__ASSERT(firstStep, "Cannot start in nullptr step");
			changeStep(firstStep);
		}

		void MenuManager::start(const std::string &firstStep)
		{
			changeStep(firstStep);
		}

		void MenuManager::changeStep(const std::string &step)
		{
			setActiveStep(findByNameAs<MenuStep>(step));
		}

		void MenuManager::changeStep(sptr<MenuStep> step)
		{
			setActiveStep(step);
		}

		void MenuManager::setActiveStep(sptr<MenuStep> step)
		{
			activateOne(step);
		}

		void MenuManager::onKeyPressed(lib::input::Key key)
		{
			_activeMenuStep->onKeyPressed(key);
		}

		void MenuManager::onKeyReleased(lib::input::Key key)
		{
			_activeMenuStep->onKeyReleased(key);
		}
	}
}<commit_msg>Crash fixed<commit_after>#include "menumanager.hpp"
#include "menustep.hpp"
#include <lib/core/log.hpp>
#include "menutheme.hpp"

namespace lib
{
	namespace menu
	{
		MenuManager::MenuManager(const std::string &name)
			: Scene{ name }
		{
//			_steps = stepsVector();
//			getSteps();
		}

		bool MenuManager::init()
		{
			using namespace draw;
			if (Scene::init())
			{
				m_mTheme = sptr<MenuTheme>(new MenuTheme{ Color{ 0, 0, 255 }, Color{ 255, 0, 0 }, 
					"game_menu.mainFont", 40,40});
				m_mTheme->setParent(this);
				return m_mTheme->init();
			}
			return false;
		}

		MenuManager::~MenuManager()
		{

		}

		void MenuManager::addMenuStep(sptr<MenuStep> step)
		{
			addRenderGroup(step);
		}

		void MenuManager::start(sptr<MenuStep> firstStep)
		{
			__ASSERT(firstStep, "Cannot start in nullptr step");
			changeStep(firstStep);
		}

		void MenuManager::start(const std::string &firstStep)
		{
			changeStep(firstStep);
		}

		void MenuManager::changeStep(const std::string &step)
		{
			setActiveStep(findByNameAs<MenuStep>(step));
		}

		void MenuManager::changeStep(sptr<MenuStep> step)
		{
			setActiveStep(step);
		}

		void MenuManager::setActiveStep(sptr<MenuStep> step)
		{
			_activeMenuStep = step;
			activateOne(step);
		}

		void MenuManager::onKeyPressed(lib::input::Key key)
		{
			_activeMenuStep->onKeyPressed(key);
		}

		void MenuManager::onKeyReleased(lib::input::Key key)
		{
			_activeMenuStep->onKeyReleased(key);
		}
	}
}
{'fraction_non_alphanumeric': 0.14669421487603307, 'fraction_numerical': 0.009641873278236915, 'mean_word_length': 4.052173913043478, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 25, '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': '6174898', 'n_tokens_mistral': 1259, 'n_tokens_neox': 1054, 'n_words': 177}