<commit_before>#include "../Include/World.hpp"
#include "../Include/Projectile.hpp"
#include "../Include/Pickup.hpp"
#include "../Include/Foreach.hpp"
#include "../Include/Ghost.hpp"
#include "../Include/Golem.hpp"
#include "../Include/DarkSoldier.hpp"
#include "../Include/Shadow.hpp"
#include "../Include/Goblin.hpp"
#include "../Include/MinotaurMage.hpp"
#include "../Include/Dwarf.hpp"
#include "../Include/MovingPlatform.hpp"
#include "../Include/Bullet.hpp"
#include "../Include/Utility.hpp"
#include "../Include/Rock.hpp"
#include "../Include/Gate.hpp"
#include "../Include/DialogPerson.hpp"
#include "../Include/Tentacle.hpp"
#include "../Include/DeadMan.hpp"

#include <SFML/Graphics/RenderWindow.hpp>

#include <algorithm>
#include <cmath>
#include <limits>


World::World(sf::RenderWindow& window, TextureHolder& textures, FontHolder& fonts, PlayerInfo* playerInfo)
: mWindow(window)
, mWorldView(window.getDefaultView())
, mTextures(textures)
, mFonts(fonts)
, mLevel(nullptr)
, mWorldBounds(0.f, 0.f, 13072.f, 3200.f)
, mSpawnPosition(mWorldView.getSize().x / 2.f, mWorldBounds.height - mWorldView.getSize().y / 2.f)
, mLevelNumber(1)
, mPosition()
, mScrollSpeed(0.f)
, mPlayerHero(nullptr)
, mPlayerInfo(playerInfo)
, mLifeBar(nullptr)
, mShadowBoss()
, mGolemBoss()
, mEnemySpawnPoints()
, mEnemies()
, mObjects()
, mTempObject(nullptr)
, mMusic()
, mSoundBuffer()
, mCasualSoundBuffer()
, mDarkSoundBuffer()
, mSound()
, mDebug(false)
{
	srand(static_cast<unsigned int>(time(NULL)));

	mSoundBuffer.loadFromFile("Media/Sounds/firebol3.ogg");
	mCasualSoundBuffer.loadFromFile("Media/Sounds/music.ogg");
	mDarkSoundBuffer.loadFromFile("Media/Sounds/DarkMusic.ogg");

	mSound.setBuffer(mSoundBuffer);

	mMusic.openFromFile("Media/Sounds/music.ogg");
	mMusic.play();
	mMusic.setLoop(true);

	buildScene();
	mWorldView.reset(sf::FloatRect(0, 0, 1280, 720));
	mWorldView.zoom(0.5f);

	//mObjects = mLevel->getObjects("solid"); // Strange line
}

void World::loadLevel(int levelNumber)
{
	mLevelNumber = levelNumber;
	switch (mLevelNumber)
	{
		case 1:
			mLevel->loadFromFile("Level1.tmx"); //     Levels/
			break;
		case 2:
			mLevel->loadFromFile("Level2.tmx");
			break;
		case 3:
			mLevel->loadFromFile("Level3.tmx");
			break;
		case 4:
			mLevel->loadFromFile("test_map.tmx");
			break;
		case 5:
			mLevel->loadFromFile("supertest_map.tmx");
			break;
		default:
			std::cout << "Error! Out of range level." << std::endl;
			mLevelNumber = 1;
			break;
	}
}

void World::update(sf::Time time)
{
	//       
	setPlayerCoordinateForView(mPlayerHero->x, mPlayerHero->y, mLevelNumber);

	for (std::list<Entity*>::iterator it = mEntities.begin(); it != mEntities.end();)
	{
		//   update  
		(*it)->update(static_cast<float>(time.asMilliseconds()));
		if ((*it)->mLife)
		{
			++it;
		}
		//   ""
		else
		{
			it = mEntities.erase(it);
			//delete (*it);
		}<commit_msg>Test Example<commit_after>#include "../Include/World.hpp"
#include "../Include/Projectile.hpp"
#include "../Include/Pickup.hpp"
#include "../Include/Foreach.hpp"
#include "../Include/Ghost.hpp"
#include "../Include/Golem.hpp"
#include "../Include/DarkSoldier.hpp"
#include "../Include/Shadow.hpp"
#include "../Include/Goblin.hpp"
#include "../Include/MinotaurMage.hpp"
#include "../Include/Dwarf.hpp"
#include "../Include/MovingPlatform.hpp"
#include "../Include/Bullet.hpp"
#include "../Include/Utility.hpp"
#include "../Include/Rock.hpp"
#include "../Include/Gate.hpp"
#include "../Include/DialogPerson.hpp"
#include "../Include/Tentacle.hpp"
#include "../Include/DeadMan.hpp"

#include <SFML/Graphics/RenderWindow.hpp>

#include <algorithm>
#include <cmath>
#include <limits>


World::World(sf::RenderWindow& window, TextureHolder& textures, FontHolder& fonts, PlayerInfo* playerInfo)
: mWindow(window)
, mWorldView(window.getDefaultView())
, mTextures(textures)
, mFonts(fonts)
, mLevel(nullptr)
, mWorldBounds(0.f, 0.f, 13072.f, 3200.f)
, mSpawnPosition(mWorldView.getSize().x / 2.f, mWorldBounds.height - mWorldView.getSize().y / 2.f)
, mLevelNumber(1)
, mPosition()
, mScrollSpeed(0.f)
, mPlayerHero(nullptr)
, mPlayerInfo(playerInfo)
, mLifeBar(nullptr)
, mShadowBoss()
, mGolemBoss()
, mEnemySpawnPoints()
, mEnemies()
, mObjects()
, mTempObject(nullptr)
, mMusic()
, mSoundBuffer()
, mCasualSoundBuffer()
, mDarkSoundBuffer()
, mSound()
, mDebug(false)
{
	srand(static_cast<unsigned int>(time(NULL)));

	mSoundBuffer.loadFromFile("Media/Sounds/firebol3.ogg");
	mCasualSoundBuffer.loadFromFile("Media/Sounds/music.ogg");
	mDarkSoundBuffer.loadFromFile("Media/Sounds/DarkMusic.ogg");

	mSound.setBuffer(mSoundBuffer);

	mMusic.openFromFile("Media/Sounds/music.ogg");
	mMusic.play();
	mMusic.setLoop(true);

	buildScene();
	mWorldView.reset(sf::FloatRect(0, 0, 1280, 720));
	mWorldView.zoom(0.5f);

	//mObjects = mLevel->getObjects("solid"); // Strange line
}

void World::loadLevel(int levelNumber)
{
	mLevelNumber = levelNumber;
	switch (mLevelNumber)
	{
		case 1:
			mLevel->loadFromFile("Level1.tmx"); //     Levels/
			break;
		case 2:
			mLevel->loadFromFile("Level2.tmx");
			break;
		case 3:
			mLevel->loadFromFile("Level3.tmx");
			break;
		case 4:
			mLevel->loadFromFile("test_map.tmx");	// Test level for Vasar.
			break;
		case 5:
			mLevel->loadFromFile("supertest_map.tmx");	// Test level for Gusev.
			break;
		default:
			std::cout << "Error! Out of range level." << std::endl;
			mLevelNumber = 1;
			break;
	}
}

void World::update(sf::Time time)
{
	//       
	setPlayerCoordinateForView(mPlayerHero->x, mPlayerHero->y, mLevelNumber);

	for (std::list<Entity*>::iterator it = mEntities.begin(); it != mEntities.end();)
	{
		//   update  
		(*it)->update(static_cast<float>(time.asMilliseconds()));
		if ((*it)->mLife)
		{
			++it;
		}
		//   ""
		else
		{
			it = mEntities.erase(it);
			//delete (*it);
		}
{'fraction_non_alphanumeric': 0.18697370682247808, 'fraction_numerical': 0.01237326001031105, 'mean_word_length': 4.532319391634981, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 37, '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': '622289', 'n_tokens_mistral': 2321, 'n_tokens_neox': 2160, 'n_words': 341}