main.cpp 725 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * main.cpp, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #include "StdInc.h"
  11. #include "../../lib/AI_Base.h"
  12. #include "BattleAI.h"
  13. #ifdef __GNUC__
  14. #define strcpy_s(a, b, c) strncpy(a, c, b)
  15. #endif
  16. static const char *g_cszAiName = "Battle AI";
  17. extern "C" DLL_EXPORT int GetGlobalAiVersion()
  18. {
  19. return AI_INTERFACE_VER;
  20. }
  21. extern "C" DLL_EXPORT void GetAiName(char* name)
  22. {
  23. strcpy_s(name, strlen(g_cszAiName) + 1, g_cszAiName);
  24. }
  25. extern "C" DLL_EXPORT void GetNewBattleAI(std::shared_ptr<CBattleGameInterface> &out)
  26. {
  27. out = std::make_shared<CBattleAI>();
  28. }