2014-01-24 10:22:18 +01:00
|
|
|
//////////////////////////////////
|
|
|
|
// Created by Sam Svensson 2013 //
|
|
|
|
//////////////////////////////////
|
|
|
|
|
|
|
|
#include "LevelLoader.h"
|
2014-02-03 14:50:15 +01:00
|
|
|
#include "LevelParser.h"
|
2014-02-05 15:46:45 +01:00
|
|
|
|
2014-01-24 10:22:18 +01:00
|
|
|
using namespace GameLogic;
|
2014-01-24 10:42:19 +01:00
|
|
|
using namespace GameLogic::LevelFileLoader;
|
|
|
|
|
2014-02-03 14:50:15 +01:00
|
|
|
struct LevelLoader::PrivData
|
|
|
|
{
|
|
|
|
LevelParser parser;
|
2014-02-05 15:46:45 +01:00
|
|
|
std::string folderPath;
|
2014-02-03 14:50:15 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
LevelLoader::LevelLoader()
|
|
|
|
: pData(new PrivData)
|
|
|
|
{
|
2014-02-05 15:46:45 +01:00
|
|
|
pData->folderPath = "Standard path";
|
2014-02-03 14:50:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
LevelLoader::~LevelLoader()
|
|
|
|
{
|
|
|
|
}
|
2014-01-24 10:22:18 +01:00
|
|
|
|
2014-02-03 14:50:15 +01:00
|
|
|
std::vector<Utility::DynamicMemory::SmartPointer<ObjectTypeHeader>> LevelLoader::LoadLevel(std::string fileName)
|
2014-01-24 10:22:18 +01:00
|
|
|
{
|
2014-02-03 14:50:15 +01:00
|
|
|
return pData->parser.Parse(fileName);
|
2014-01-24 10:22:18 +01:00
|
|
|
}
|
|
|
|
|
2014-01-28 11:27:29 +01:00
|
|
|
LevelMetaData LevelLoader::LoadLevelHeader(std::string fileName)
|
2014-01-24 10:22:18 +01:00
|
|
|
{
|
2014-02-03 14:50:15 +01:00
|
|
|
return pData->parser.ParseHeader(fileName);
|
2014-01-24 10:22:18 +01:00
|
|
|
}
|