main.cpp 674 B

123456789101112131415161718192021222324252627282930313233343536
  1. #include "StdInc.h"
  2. #include "../../lib/AI_Base.h"
  3. #include "BattleAI.h"
  4. #ifdef __GNUC__
  5. #define strcpy_s(a, b, c) strncpy(a, c, b)
  6. #endif
  7. const char *g_cszAiName = "Battle AI";
  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 char* GetAiNameS()
  17. {
  18. // need to be defined
  19. return NULL;
  20. }
  21. extern "C" DLL_EXPORT CBattleGameInterface* GetNewBattleAI()
  22. {
  23. return new CBattleAI();
  24. }
  25. extern "C" DLL_EXPORT void ReleaseBattleAI(CBattleGameInterface* i)
  26. {
  27. delete (CBattleAI*)i;
  28. }