Update to work for latest builds.

This commit is contained in:
Deukhoofd 2021-11-05 14:04:17 +01:00
parent eb8c0caea4
commit 175fc37be9
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
5 changed files with 10 additions and 7 deletions

View File

@ -1,8 +1,10 @@
#ifndef PKMNLIB_AI_CORE_HPP #ifndef PKMNLIB_AI_CORE_HPP
#define PKMNLIB_AI_CORE_HPP #define PKMNLIB_AI_CORE_HPP
#include <Arbutils/Exception.hpp>
#include <cstring> #include <cstring>
#include <exception> #include <exception>
#include <sstream>
#include <string> #include <string>
#define export extern "C" [[maybe_unused]] #define export extern "C" [[maybe_unused]]

View File

@ -14,7 +14,6 @@ include_pkmnlib()
file(GLOB_RECURSE SRC_FILES src/*.cpp src/*.hpp CInterface/pkmnlibai.cpp CInterface/Core.cpp) file(GLOB_RECURSE SRC_FILES src/*.cpp src/*.hpp CInterface/pkmnlibai.cpp CInterface/Core.cpp)
add_library(pkmnlib_ai SHARED ${SRC_FILES}) add_library(pkmnlib_ai SHARED ${SRC_FILES})
target_precompile_headers(pkmnlib_ai PUBLIC src/Precompiled.hxx)
set_target_properties(pkmnlib_ai PROPERTIES LINKER_LANGUAGE CXX) set_target_properties(pkmnlib_ai PROPERTIES LINKER_LANGUAGE CXX)
add_definitions(-DLEVEL_U8) add_definitions(-DLEVEL_U8)
@ -31,7 +30,7 @@ if (WINDOWS)
endif (WINDOWS) endif (WINDOWS)
SET(_LINKS Arbutils CreatureLib pkmnLib -lpthread) SET(_LINKS Arbutils CreatureLib pkmnLib angelscript -lpthread)
target_link_libraries(pkmnlib_ai PUBLIC ${_LINKS}) target_link_libraries(pkmnlib_ai PUBLIC ${_LINKS})
target_compile_options(pkmnlib_ai PRIVATE -Wall -Wextra -Werror) target_compile_options(pkmnlib_ai PRIVATE -Wall -Wextra -Werror)
@ -40,5 +39,5 @@ if (AIRUNNER)
file(GLOB_RECURSE RUNNER_SRC_FILES test_runner/*.cpp test_runner/*.hpp) file(GLOB_RECURSE RUNNER_SRC_FILES test_runner/*.cpp test_runner/*.hpp)
add_executable(pkmnlib_ai_runner ${RUNNER_SRC_FILES}) add_executable(pkmnlib_ai_runner ${RUNNER_SRC_FILES})
target_compile_options(pkmnlib_ai_runner PRIVATE -Wall -Wextra -Werror) target_compile_options(pkmnlib_ai_runner PRIVATE -Wall -Wextra -Werror)
target_link_libraries(pkmnlib_ai_runner PUBLIC pkmnlib_ai -lpthread) target_link_libraries(pkmnlib_ai_runner PUBLIC pkmnlib_ai ${_LINKS})
endif() endif()

View File

@ -42,9 +42,10 @@ function(include_pkmnlib)
${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/include/PkmnLib) ${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/include/PkmnLib)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/include include_directories(${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/include
${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/bin/CreatureLib/include ${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/src/pkmnlib/extern/AngelscriptDebuggerServer/extern/asio-1.18.2/include
${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/bin/Angelscript/src/AngelscriptProj/angelscript/include ${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/bin/CreatureLib/include
${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/bin/CreatureLib/bin/Arbutils/include) ${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/bin/Angelscript/src/AngelscriptProj/angelscript/include
${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/bin/CreatureLib/bin/Arbutils/include)
endfunction() endfunction()

View File

@ -171,6 +171,7 @@ namespace PkmnLibAI {
case CreatureLib::Library::AttackTarget::RandomOpponent: return GetOppositeIndex(user); case CreatureLib::Library::AttackTarget::RandomOpponent: return GetOppositeIndex(user);
case CreatureLib::Library::AttackTarget::Self: return user->GetBattleIndex(); case CreatureLib::Library::AttackTarget::Self: return user->GetBattleIndex();
} }
return {};
} }
SimulatedResult SimulateTurn(PkmnLib::Battling::Battle* originalBattle, u8 sideIndex, u8 pokemonIndex, u8 index, SimulatedResult SimulateTurn(PkmnLib::Battling::Battle* originalBattle, u8 sideIndex, u8 pokemonIndex, u8 index,

@ -1 +1 @@
Subproject commit e69eacaa9bd65ab2d6f1c42749f5a0734423f3c9 Subproject commit d3e95dad61c5ce60db17db905fec4eeb4f65fdce