Adds C Interface.
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <CreatureLib/Battling/TurnChoices/SwitchTurnChoice.hpp>
|
||||
#include <PkmnLib/Battling/Pokemon/LearnedMove.hpp>
|
||||
#include <algorithm>
|
||||
#include <angelscript.h>
|
||||
#include <future>
|
||||
#include <thread>
|
||||
#include "../cmake-build-release/PkmnLib/src/pkmnlib/src/Battling/Pokemon/PokemonParty.hpp"
|
||||
@@ -92,7 +93,7 @@ namespace PkmnLibAI {
|
||||
}));
|
||||
}
|
||||
std::vector<std::tuple<u8, float>> results(threadPool.size());
|
||||
for (int i = 0; i < threadPool.size(); ++i) {
|
||||
for (size_t i = 0; i < threadPool.size(); ++i) {
|
||||
results[i] = threadPool[i].get();
|
||||
}
|
||||
return results;
|
||||
@@ -111,7 +112,7 @@ namespace PkmnLibAI {
|
||||
scoredMoves.emplace_back(moveIndex, scored);
|
||||
}
|
||||
auto& party = battle->GetParties()[side->GetSideIndex()]->GetParty()->GetParty();
|
||||
for (int i = 0; i < party.Count(); ++i) {
|
||||
for (size_t i = 0; i < party.Count(); ++i) {
|
||||
auto mon = party[i];
|
||||
if (!mon.HasValue()) {
|
||||
continue;
|
||||
|
||||
@@ -15,6 +15,7 @@ namespace PkmnLibAI {
|
||||
|
||||
virtual std::string GetName() const noexcept = 0;
|
||||
|
||||
protected:
|
||||
CreatureLib::Battling::CreatureIndex GetOppositeIndex(PkmnLib::Battling::Pokemon* user) {
|
||||
auto side = user->GetBattleSide().GetValue();
|
||||
if (side->GetSideIndex() == 0) {
|
||||
|
||||
Reference in New Issue
Block a user