DLLMain.cpp 697 B

123456789101112131415161718192021222324252627282930313233343536
  1. #define VCMI_DLL
  2. #pragma warning (disable: 4100 4251 4245 4018 4081)
  3. #include "../../AI_Base.h"
  4. #pragma warning (default: 4100 4251 4245 4018 4081)
  5. #include "CGeniusAI.h"
  6. using namespace GeniusAI;
  7. const char *g_cszAiName = "Genius 1.0";
  8. extern "C" DLL_EXPORT int GetGlobalAiVersion()
  9. {
  10. return AI_INTERFACE_VER;
  11. }
  12. extern "C" DLL_EXPORT void GetAiName(char* name)
  13. {
  14. strcpy_s(name, strlen(g_cszAiName) + 1, g_cszAiName);
  15. }
  16. extern "C" DLL_EXPORT char* GetAiNameS()
  17. {
  18. // need to be defined
  19. return NULL;
  20. }
  21. extern "C" DLL_EXPORT CGlobalAI* GetNewAI()
  22. {
  23. return new CGeniusAI();
  24. }
  25. extern "C" DLL_EXPORT void ReleaseAI(CGlobalAI* i)
  26. {
  27. delete (CGeniusAI*)i;
  28. }