main.cpp 531 B

12345678910111213141516171819202122232425
  1. #include "StdInc.h"
  2. #include "../../lib/AI_Base.h"
  3. #include "StupidAI.h"
  4. #ifdef __GNUC__
  5. #define strcpy_s(a, b, c) strncpy(a, c, b)
  6. #endif
  7. static const char *g_cszAiName = "Stupid AI 0.1";
  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 void GetNewBattleAI(std::shared_ptr<CBattleGameInterface> &out)
  17. {
  18. out = std::make_shared<CStupidAI>();
  19. }