main.cpp 498 B

123456789101112131415161718192021222324
  1. #include "stdafx.h"
  2. #include "StupidAI.h"
  3. #include <cstring>
  4. #ifdef __GNUC__
  5. #define strcpy_s(a, b, c) strncpy(a, c, b)
  6. #endif
  7. const char *g_cszAiName = "Stupid AI 0.1";
  8. extern "C" DLL_F_EXPORT void GetAiName(char* name)
  9. {
  10. strcpy_s(name, strlen(g_cszAiName) + 1, g_cszAiName);
  11. }
  12. extern "C" DLL_F_EXPORT CBattleGameInterface* GetNewBattleAI()
  13. {
  14. return new CStupidAI();
  15. }
  16. extern "C" DLL_F_EXPORT void ReleaseBattleAI(CBattleGameInterface* i)
  17. {
  18. delete (CStupidAI*)i;
  19. }