main.cpp 701 B

1234567891011121314151617181920212223242526272829303132
  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 "BattleAI.h"
  12. #ifdef __GNUC__
  13. #define strcpy_s(a, b, c) strncpy(a, c, b)
  14. #endif
  15. static const char * const g_cszAiName = "Battle AI";
  16. extern "C" DLL_EXPORT int GetGlobalAiVersion()
  17. {
  18. return AI_INTERFACE_VER;
  19. }
  20. extern "C" DLL_EXPORT void GetAiName(char* name)
  21. {
  22. strcpy_s(name, strlen(g_cszAiName) + 1, g_cszAiName);
  23. }
  24. extern "C" DLL_EXPORT void GetNewBattleAI(std::shared_ptr<CBattleGameInterface> &out)
  25. {
  26. out = std::make_shared<CBattleAI>();
  27. }