2014-01-24 09:00:59 +01:00
|
|
|
#ifndef LEVEL_PARSER_H
|
|
|
|
#define LEVEL_PARSER_H
|
|
|
|
|
2014-01-24 10:01:58 +01:00
|
|
|
#include <string>
|
2014-01-24 09:00:59 +01:00
|
|
|
#include <vector>
|
|
|
|
#include "ObjectDefines.h"
|
|
|
|
|
|
|
|
namespace GameLogic
|
|
|
|
{
|
2014-01-24 10:42:19 +01:00
|
|
|
namespace LevelFileLoader
|
2014-01-24 09:00:59 +01:00
|
|
|
{
|
|
|
|
class LevelParser
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
LevelParser();
|
|
|
|
~LevelParser();
|
|
|
|
|
|
|
|
//
|
2014-01-24 10:01:58 +01:00
|
|
|
std::vector<ObjectTypeHeader> Parse(std::string filename);
|
2014-01-24 09:00:59 +01:00
|
|
|
|
|
|
|
//
|
2014-01-24 10:01:58 +01:00
|
|
|
ObjectTypeHeader ParseHeader(std::string filename);
|
2014-01-24 09:00:59 +01:00
|
|
|
|
|
|
|
private:
|
2014-01-24 10:01:58 +01:00
|
|
|
static const int TypeHeaderSize = 4; //Including the TypeID
|
|
|
|
static const int ObjectHeaderSize = 10; //Including modelID, textureID, position, rotation, scale.
|
|
|
|
static const int LevelHeaderSize = 10; //Including Format version, Name, Map version etc.
|
|
|
|
|
|
|
|
static const int FormatVersionMajor = 1;
|
|
|
|
static const int FormatVersionMinor = 0;
|
|
|
|
|
|
|
|
/*************************************
|
|
|
|
Question
|
|
|
|
*************************************/
|
|
|
|
//Could we use the IDs in "ObjectDefines.h" or do we have to use our own???
|
|
|
|
enum TypeID
|
|
|
|
{
|
|
|
|
TypeID_LevelHeader,
|
|
|
|
TypeID_Player,
|
|
|
|
TypeID_Object,
|
|
|
|
|
|
|
|
|
|
|
|
TypeID_NUM_OF_TYPES,
|
|
|
|
|
|
|
|
ObjectType_Unknown = -1,
|
|
|
|
};
|
2014-01-24 09:00:59 +01:00
|
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|