Danbias/Code/Game/GameLogic/LevelLoader/LevelLoader.cpp

52 lines
1.0 KiB
C++
Raw Normal View History

//////////////////////////////////
// Created by Sam Svensson 2013 //
//////////////////////////////////
#include "LevelLoader.h"
#include "LevelParser.h"
using namespace GameLogic;
using namespace GameLogic::LevelFileLoader;
struct LevelLoader::PrivData
{
LevelParser parser;
std::wstring folderPath;
};
LevelLoader::LevelLoader()
: pData(new PrivData)
{
2014-02-10 16:24:05 +01:00
//standard path
pData->folderPath = L"";
2014-02-10 16:24:05 +01:00
}
LevelLoader::LevelLoader(std::wstring folderPath)
2014-02-10 16:24:05 +01:00
: pData(new PrivData)
{
pData->folderPath = folderPath;
}
LevelLoader::~LevelLoader()
{
}
std::vector<Utility::DynamicMemory::SmartPointer<ObjectTypeHeader>> LevelLoader::LoadLevel(std::wstring fileName)
{
2014-02-10 16:24:05 +01:00
return pData->parser.Parse(pData->folderPath + fileName);
}
LevelMetaData LevelLoader::LoadLevelHeader(std::wstring fileName)
{
2014-02-10 16:24:05 +01:00
return pData->parser.ParseHeader(pData->folderPath + fileName);
}
std::wstring LevelLoader::GetFolderPath()
2014-02-10 16:24:05 +01:00
{
return this->pData->folderPath;
}
void LevelLoader::SetFolderPath(std::wstring folderPath)
2014-02-10 16:24:05 +01:00
{
this->pData->folderPath = folderPath;
}