DLLMain.cpp 787 B

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