2016-03-01 15:47:10 +00:00
|
|
|
#ifndef __P_UDMF_H
|
|
|
|
#define __P_UDMF_H
|
|
|
|
|
|
|
|
#include "sc_man.h"
|
|
|
|
#include "m_fixed.h"
|
|
|
|
|
|
|
|
class UDMFParserBase
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
FScanner sc;
|
2018-08-18 23:14:15 +00:00
|
|
|
FName namespc = NAME_None;
|
2016-03-01 15:47:10 +00:00
|
|
|
int namespace_bits;
|
|
|
|
FString parsedString;
|
2017-03-23 09:19:07 +00:00
|
|
|
bool BadCoordinates = false;
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
void Skip();
|
|
|
|
FName ParseKey(bool checkblock = false, bool *isblock = NULL);
|
2020-04-11 10:58:38 +00:00
|
|
|
int CheckInt(FName key);
|
|
|
|
double CheckFloat(FName key);
|
|
|
|
double CheckCoordinate(FName key);
|
|
|
|
DAngle CheckAngle(FName key);
|
|
|
|
bool CheckBool(FName key);
|
|
|
|
const char *CheckString(FName key);
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
template<typename T>
|
2020-04-11 10:58:38 +00:00
|
|
|
bool Flag(T &value, int mask, FName key)
|
2016-03-01 15:47:10 +00:00
|
|
|
{
|
|
|
|
if (CheckBool(key))
|
2019-12-22 09:20:47 +00:00
|
|
|
{
|
2016-03-01 15:47:10 +00:00
|
|
|
value |= mask;
|
2019-12-22 09:20:47 +00:00
|
|
|
return true;
|
|
|
|
}
|
2016-03-01 15:47:10 +00:00
|
|
|
else
|
2019-12-22 09:20:47 +00:00
|
|
|
{
|
2016-03-01 15:47:10 +00:00
|
|
|
value &= ~mask;
|
2019-12-22 09:20:47 +00:00
|
|
|
return false;
|
|
|
|
}
|
2016-03-01 15:47:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#define BLOCK_ID (ENamedName)-1
|
|
|
|
|
2010-08-20 12:20:51 +00:00
|
|
|
#endif
|