<commit_before>#include "Game.hpp"

Game::Game()
{
}

Game::~Game()
{
	Destroy();
}

bool Game::Initialize(Score * score)
{
	scoreHandler = score;
	enemyDirection = true;
	finished = false;
	victory = false;
	return true;
}

bool Game::Destroy()
{
	player.Shutdown();

	enemies.clear();
	walls.clear();
	bullets.clear();

	return true;
}

int Game::RenderGame(sf::RenderWindow * window, const sf::Time &frameTime)
{
	FinishGameCheck(window, frameTime);

	if (!finished)
	{
		//InputCheck(frameTime.asSeconds());

		BulletCheck();

		aiMove(frameTime);
		enemyFire();

		window->draw(*player.GetModel());
		for (int i = 0; i < bullets.size(); ++i)
		{
			if (bullets.at(i).IsAlive())
			{
				bullets.at(i).Move(100 * frameTime.asSeconds());
				window->draw(*bullets.at(i).GetModel());
			}
		}
		for (int i = 0; i < enemies.size(); ++i)
		{
			if (enemies.at(i).IsAlive())
			{
				if ((enemies.at(i).GetPosX() < 0 || enemies.at(i).GetPosX() > 800) && !enemyDescent)
				{
					enemyDirection = !enemyDirection;
					enemyDescent = true;

					if (enemies.at(i).GetPosX() < 0)
					{
						boundaryCompensation = -enemies.at(i).GetPosX();
					}
					else
					{
						boundaryCompensation = 800 - enemies.at(i).GetPosX();
					}
				}
				window->draw(*enemies.at(i).GetModel());
			}
		}

		for (int i = 0; i < walls.size(); ++i)
		{
			if (walls.at(i).IsAlive())
			{
				window->draw(*walls.at(i).GetModel());
			}
		}

		window->draw(scoreHandler->GetTotalScore());
		window->draw(scoreHandler->GetHighScore());
	}
	else
	{
		if (victory)
		{
			if (scoreHandler->winScore(window))
			{
				scoreHandler->SaveScore();
				return 1;<commit_msg>Changed loops to for each instead<commit_after>#include "Game.hpp"

Game::Game()
{
}

Game::~Game()
{
	Destroy();
}

bool Game::Initialize(Score * score)
{
	scoreHandler = score;
	enemyDirection = true;
	finished = false;
	victory = false;
	return true;
}

bool Game::Destroy()
{
	player.Shutdown();

	enemies.clear();
	walls.clear();
	bullets.clear();

	return true;
}

int Game::RenderGame(sf::RenderWindow * window, const sf::Time &frameTime)
{
	FinishGameCheck(window, frameTime);

	if (!finished)
	{
		//InputCheck(frameTime.asSeconds());

		BulletCheck();

		aiMove(frameTime);
		enemyFire();

		window->draw(*player.GetModel());
		for (auto& bullet : bullets)
		{
			if (bullet.IsAlive())
			{
				bullet.Move(100 * frameTime.asSeconds());
				window->draw(*bullet.GetModel());
			}
		}
		for (auto& enemy : enemies)
		{
			if (enemy.IsAlive())
			{
				if ((enemy.GetPosX() < 0 || enemy.GetPosX() > 800) && !enemyDescent)
				{
					enemyDirection = !enemyDirection;
					enemyDescent = true;

					if (enemy.GetPosX() < 0)
					{
						boundaryCompensation = -enemy.GetPosX();
					}
					else
					{
						boundaryCompensation = 800 - enemy.GetPosX();
					}
				}
				window->draw(*enemy.GetModel());
			}
		}

		for (auto& wall : walls)
		{
			if (wall.IsAlive())
			{
				window->draw(*wall.GetModel());
			}
		}

		window->draw(scoreHandler->GetTotalScore());
		window->draw(scoreHandler->GetHighScore());
	}
	else
	{
		if (victory)
		{
			if (scoreHandler->winScore(window))
			{
				scoreHandler->SaveScore();
				return 1;
{'fraction_non_alphanumeric': 0.18350062735257214, 'fraction_numerical': 0.008469259723964869, 'mean_word_length': 3.168627450980392, 'pattern_counts': {'":': 0, '<': 10, '<?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': '3995793', 'n_tokens_mistral': 1467, 'n_tokens_neox': 1181, 'n_words': 199}