main.cpp 581 B

123456789101112131415161718192021222324252627282930
  1. #include "stdafx.h"
  2. #include "StupidAI.h"
  3. const char *g_cszAiName = "Stupid AI 0.1";
  4. extern "C" DLL_F_EXPORT int GetGlobalAiVersion()
  5. {
  6. return AI_INTERFACE_VER;
  7. }
  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 char* GetAiNameS()
  13. {
  14. // need to be defined
  15. return NULL;
  16. }
  17. extern "C" DLL_F_EXPORT CBattleGameInterface* GetNewBattleAI()
  18. {
  19. return new CStupidAI();
  20. }
  21. extern "C" DLL_F_EXPORT void ReleaseBattleAI(CBattleGameInterface* i)
  22. {
  23. delete (CStupidAI*)i;
  24. }