2011-07-18 08:34:30 +00:00
|
|
|
#ifndef GAME_EDITOR_AUTO_MAP_H
|
|
|
|
#define GAME_EDITOR_AUTO_MAP_H
|
2011-07-08 23:09:06 +00:00
|
|
|
|
2022-05-24 09:24:33 +00:00
|
|
|
#include <vector>
|
2011-07-08 23:09:06 +00:00
|
|
|
|
|
|
|
class CAutoMapper
|
|
|
|
{
|
2015-02-19 21:54:47 +00:00
|
|
|
struct CIndexInfo
|
|
|
|
{
|
|
|
|
int m_ID;
|
|
|
|
int m_Flag;
|
2018-08-09 21:45:04 +00:00
|
|
|
bool m_TestFlag;
|
2015-02-19 21:54:47 +00:00
|
|
|
};
|
|
|
|
|
2011-07-08 23:09:06 +00:00
|
|
|
struct CPosRule
|
|
|
|
{
|
|
|
|
int m_X;
|
|
|
|
int m_Y;
|
|
|
|
int m_Value;
|
2022-06-11 19:38:18 +00:00
|
|
|
std::vector<CIndexInfo> m_vIndexList;
|
2011-08-11 08:59:14 +00:00
|
|
|
|
2011-07-08 23:09:06 +00:00
|
|
|
enum
|
|
|
|
{
|
2020-09-26 19:41:58 +00:00
|
|
|
NORULE = 0,
|
2015-02-19 21:54:47 +00:00
|
|
|
INDEX,
|
|
|
|
NOTINDEX
|
2011-07-08 23:09:06 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CIndexRule
|
|
|
|
{
|
|
|
|
int m_ID;
|
2022-06-11 19:38:18 +00:00
|
|
|
std::vector<CPosRule> m_vRules;
|
2011-07-08 23:09:06 +00:00
|
|
|
int m_Flag;
|
2018-07-24 18:41:36 +00:00
|
|
|
float m_RandomProbability;
|
2014-09-20 18:57:29 +00:00
|
|
|
bool m_DefaultRule;
|
2018-08-11 01:01:25 +00:00
|
|
|
bool m_SkipEmpty;
|
|
|
|
bool m_SkipFull;
|
2011-07-08 23:09:06 +00:00
|
|
|
};
|
|
|
|
|
2015-02-19 23:15:09 +00:00
|
|
|
struct CRun
|
2011-07-08 23:09:06 +00:00
|
|
|
{
|
2022-06-11 19:38:18 +00:00
|
|
|
std::vector<CIndexRule> m_vIndexRules;
|
2018-07-19 15:09:29 +00:00
|
|
|
bool m_AutomapCopy;
|
2015-02-19 23:15:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct CConfiguration
|
|
|
|
{
|
2022-06-11 19:38:18 +00:00
|
|
|
std::vector<CRun> m_vRuns;
|
2011-07-08 23:09:06 +00:00
|
|
|
char m_aName[128];
|
2018-10-04 13:26:41 +00:00
|
|
|
int m_StartX;
|
|
|
|
int m_StartY;
|
|
|
|
int m_EndX;
|
|
|
|
int m_EndY;
|
2011-07-08 23:09:06 +00:00
|
|
|
};
|
2011-08-11 08:59:14 +00:00
|
|
|
|
2011-07-08 23:09:06 +00:00
|
|
|
public:
|
|
|
|
CAutoMapper(class CEditor *pEditor);
|
2011-08-11 08:59:14 +00:00
|
|
|
|
2020-09-26 19:41:58 +00:00
|
|
|
void Load(const char *pTileName);
|
|
|
|
void ProceedLocalized(class CLayerTiles *pLayer, int ConfigID, int Seed = 0, int X = 0, int Y = 0, int Width = -1, int Height = -1);
|
|
|
|
void Proceed(class CLayerTiles *pLayer, int ConfigID, int Seed = 0, int SeedOffsetX = 0, int SeedOffsetY = 0);
|
2011-07-08 23:09:06 +00:00
|
|
|
|
2022-06-11 19:38:18 +00:00
|
|
|
int ConfigNamesNum() const { return m_vConfigs.size(); }
|
2020-09-26 19:41:58 +00:00
|
|
|
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; }
|
2020-09-26 19:41:58 +00:00
|
|
|
|
2011-07-08 23:09:06 +00:00
|
|
|
private:
|
2022-06-11 19:38:18 +00:00
|
|
|
std::vector<CConfiguration> m_vConfigs;
|
2011-07-08 23:09:06 +00:00
|
|
|
class CEditor *m_pEditor;
|
|
|
|
bool m_FileLoaded;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|