ddnet/src/game/editor/auto_map.h

68 lines
985 B
C
Raw Normal View History

2011-07-18 08:34:30 +00:00
#ifndef GAME_EDITOR_AUTO_MAP_H
#define GAME_EDITOR_AUTO_MAP_H
#include <base/tl/array.h>
class CAutoMapper
{
2015-02-19 21:54:47 +00:00
struct CIndexInfo
{
int m_ID;
int m_Flag;
};
struct CPosRule
{
int m_X;
int m_Y;
int m_Value;
2015-02-19 21:54:47 +00:00
array<CIndexInfo> m_aIndexList;
2011-08-11 08:59:14 +00:00
enum
{
2015-02-19 21:54:47 +00:00
NORULE=0,
INDEX,
NOTINDEX
};
};
struct CIndexRule
{
int m_ID;
array<CPosRule> m_aRules;
int m_Flag;
float m_RandomProbability;
bool m_DefaultRule;
};
2015-02-19 23:15:09 +00:00
struct CRun
{
array<CIndexRule> m_aIndexRules;
2018-07-19 15:09:29 +00:00
bool m_AutomapCopy;
2015-02-19 23:15:09 +00:00
};
struct CConfiguration
{
array<CRun> m_aRuns;
char m_aName[128];
};
2011-08-11 08:59:14 +00:00
public:
CAutoMapper(class CEditor *pEditor);
2011-08-11 08:59:14 +00:00
void Load(const char* pTileName);
void Proceed(class CLayerTiles *pLayer, int ConfigID);
2017-07-09 08:27:58 +00:00
int ConfigNamesNum() const { return m_lConfigs.size(); }
const char* GetConfigName(int Index);
2011-08-11 08:59:14 +00:00
2017-07-09 08:27:58 +00:00
bool IsLoaded() const { return m_FileLoaded; }
private:
array<CConfiguration> m_lConfigs;
class CEditor *m_pEditor;
bool m_FileLoaded;
};
#endif