main.cpp 666 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 "VCAI.h"
  12. #ifdef __GNUC__
  13. #define strcpy_s(a, b, c) strncpy(a, c, b)
  14. #endif
  15. static const char * g_cszAiName = "VCAI";
  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 GetNewAI(std::shared_ptr<CGlobalAI> & out)
  25. {
  26. out = std::make_shared<VCAI>();
  27. }