Files
mir_server/server/robot/Scene/SceneConfigLoader.h

183 lines
4.1 KiB
C
Raw Normal View History

2025-01-09 17:45:40 +08:00
#pragma once
#include "JXAbsGameMap.h"
#include <functional>
typedef struct tagNpcName
{
int nId;
char sName[32];
}NPCNAME,*PNPCNAME;
struct tagSceneMapConf: public tagSceneConfig
{
jxcomm::gameMap::CAbstractMap m_MapData; //地图点数据
tagSceneMapConf():m_MapData(){}
};
typedef struct tagSceneMapConf SCENEMAPCONF, *PSCENEMAPCONF;
struct SceneMapConfigList
{
int nCount;
SCENEMAPCONF* pList;
};
class CSceneConfigLoader : public CCustomLogicLuaConfig
{
public:
const static LPCTSTR szEnvirConfigFileName;
const static int snNormalFubenID = 0; // 常规副本普通场景的副本Id
CSceneConfigLoader();
/*
* Comments:
* Param LPCTSTR szFileName:
* @Return bool:
* @Remark:
*/
bool Load();
/*
* Comments:
* Param int nSceneId: Id
* @Return SCENECONFIG*:
* @Remark:
*/
SCENEMAPCONF* GetSceneConfig(int nSceneId);
/*
* Comments:
* Param const int nSceneId:Id
* Param int & nX:
* Param int & nY:
* @Return void:
* @Remark:
*/
void GetRandomRefreshPos(const int nSceneId, int& nX, int& nY);
/*
* Comments:
* Param const int nSceneId: Id
* Param const int nX: X
* Param const int nY: Y
* @Return bool: truefalse
* @Remark:
*/
bool CanMove(const int nSceneId, const int nX, const int nY);
/*
* Comments:
* Param const int nSceneId: Id
* Param const int nX: X
* Param const int nY: Y
* @Return bool: truefalse
* @Remark:
*/
bool IsTeleport(const int nSceneId, const int nX, const int nY);
/*
* Comments:
* Param int& nX:
* Param int& nY:
* @Return void:
* @Remark:
*/
static void GetSceneDefaultPoint(SCENECONFIG* sc, int& nX, int& nY);
/*
* Comments:id和实体id取x,y坐标
* Param int nSceneId:
* Param int nEntityId:
* Param int & nX:
* Param int & nY:
* @Return bool:
*/
bool GetMonsterPos(int nSceneId, int nEntityId, int & nX, int & nY);
private:
CObjectAllocator<char> m_DataAllocator;
SceneMapConfigList m_sceneConfigList; // 场景(公共地图,不处理副本了)
protected:
/*
* Comments:
* Param LPCTSTR sError:
* @Return void:
* @Remark:
*/
void showError(LPCTSTR sError);
/*
* Comments:
* @Return bool:
* @Remark:
*/
bool LoadSceneConfig();
/*
* Comments:
* Param SCENECONFIG * sceneConf:
* @Return bool:
* @Remark:
*/
bool LoadAreasConfig(SCENECONFIG* sceneConf);
/*
* Comments:npc配置
* Param SCENECONFIG * sceneConf:
* @Return bool:
*/
bool LoadNpcConfig(SCENECONFIG * sceneConf);
/*
* Comments: FB配置数据
* Param int nId:
* Param int nFBId: Id
* @Return bool:
* @Remark: ID和索引是相同的
*/
bool ReadSingleFBConfig(int nId, int nFBId);
/*
* Comments:
* Param SCENECONFIG * sceneConf:
* Param SCENEAREA * area:
* @Return bool:
* @Remark:
*/
bool LoadAreaRangeConfig(SCENECONFIG* sceneConf, SCENEAREA* area);
/*
* Comments:
* Param SCENECONFIG * sceneConf:
* Param SCENEAREA * area:
* @Return bool:
* @Remark:
*/
bool LoadAreaCenterConfig(SCENECONFIG* sceneConf, SCENEAREA* area);
/*
* Comments:
* Param SCENECONFIG * sceneConf:
* @Return bool:
* @Remark:
*/
bool LoadTelePortConfig(SCENECONFIG* sceneConf);
/*
* Comments:
* Param SCENECONFIG * sceneConf:
*/
bool LoadHookConfig(SCENECONFIG* sceneConf);
/*
* Comments:
* Param SCENECONFIG * sceneConf:
* @Return bool:
* @Remark:
*/
bool LoadRefreshConfig(SCENECONFIG* sceneConf);
/*
* Comments:
* @Return bool:
* @Remark:
*/
bool LoadSceneMap(SCENEMAPCONF* sceneConf);
};