#pragma once
class CScriptTypeInfo;
class CScriptEventTypeInfo;
class CReloadableNPCEventHandler;
namespace AIGuard
{
/*
LoadNPCAI() should be called in case when CNPCAIManager::LoadNPCAI() was re-implemented
*/
typedef bool (*tLoadNPCAI)(void);
/*
FindClass() should be called in case when CNPC::SetAI() & CNpcMakerEx::SetAI() was re-implemented
*/
typedef CReloadableNPCEventHandler* (*tFindClass)(int nClassTypeId, const wchar_t* pwsClassName);
/*
OnAILoaded() is required and should be implemented!!!. You should create NPCs here (Tutorial_quest_npc, Dominion_quest_npc, ...)
Example:
g_pTutorial_quest_npc = new CNPC();
g_pTutorial_quest_npc->Set(0,0);
g_pTutorial_quest_npc->SetAI(L"tutorial_quest_npc");
*/
typedef void (*tOnAILoaded)(void);
/*
GetTypeInfo() & GetEventTypeInfo() are required and should be implemented!!!
This functions used by AIGuard to access AI-types information
*/
typedef CScriptTypeInfo** (*tGetTypeInfo)(int nTypeId);
typedef CScriptEventTypeInfo** (*tGetEventTypeInfo)(int nEventTypeId);
/*
AIGuardInit() should be called before NPCServer::Start()
*/
typedef struct _InitData
{
_InitData()
: m_nAIGuardRevision(0)
, m_lpfLoadNPCAI(NULL)
, m_lpfFindClass(NULL)
, m_lpfOnAILoaded(NULL)
, m_lpfGetTypeInfo(NULL)
, m_lpfGetEventTypeInfo(NULL)
, m_pszRevision_SharedFactory(NULL)
, m_pszRevision_NpcH(NULL)
, m_pszRevision_NASC(NULL)
, m_pszRevision_NpcEvent(NULL)
{}
/*out*/ int m_nAIGuardRevision;
/*out*/ tLoadNPCAI m_lpfLoadNPCAI;
/*out*/ tFindClass m_lpfFindClass;
/*in*/ tOnAILoaded m_lpfOnAILoaded;
/*in*/ tGetTypeInfo m_lpfGetTypeInfo;
/*in*/ tGetEventTypeInfo m_lpfGetEventTypeInfo;
/*in*/ const char* m_pszRevision_SharedFactory;
/*in*/ const char* m_pszRevision_NpcH;
/*in*/ const char* m_pszRevision_NASC;
/*in*/ const char* m_pszRevision_NpcEvent;
} InitData;
typedef BOOL (*tAIGuardInit)(InitData& initData);
}// namespace AIGuard
extern "C" BOOL AIGuardInit(AIGuard::InitData& initData);