1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

enable StupidAI and EmptyAI for static AI

This commit is contained in:
Andrey Filipenkov
2023-02-28 13:08:58 +03:00
parent c31a9f7f5d
commit 0294a8b063
7 changed files with 33 additions and 18 deletions

View File

@ -20,6 +20,8 @@
# include "AI/VCAI/VCAI.h"
# include "AI/Nullkiller/AIGateway.h"
# include "AI/BattleAI/BattleAI.h"
# include "AI/StupidAI/StupidAI.h"
# include "AI/EmptyAI/CEmptyAI.h"
#else
# ifdef VCMI_WINDOWS
# include <windows.h> //for .dll libs
@ -113,7 +115,11 @@ std::shared_ptr<CGlobalAI> createAny(const boost::filesystem::path & libpath, co
template<>
std::shared_ptr<CBattleGameInterface> createAny(const boost::filesystem::path & libpath, const std::string & methodName)
{
return std::make_shared<CBattleAI>();
if(libpath.stem() == "libBattleAI")
return std::make_shared<CBattleAI>();
else if(libpath.stem() == "libStupidAI")
return std::make_shared<CStupidAI>();
return std::make_shared<CEmptyAI>();
}
#endif // STATIC_AI