PkmnLibAI/test_runner/AIResolver.hpp

22 lines
648 B
C++
Raw Normal View History

2021-04-18 11:37:14 +00:00
#ifndef PKMNLIB_AI_AIRESOLVER_HPP
#define PKMNLIB_AI_AIRESOLVER_HPP
#include "../src/DepthSearchAI.hpp"
#include "../src/NaiveAI.hpp"
#include "../src/PokemonAI.hpp"
#include "../src/RandomAI.hpp"
class AIResolver {
public:
static PkmnLibAI::PokemonAI* Resolve(const ArbUt::StringView& name) {
switch (name) {
case "random"_cnc: return new PkmnLibAI::RandomAI();
case "depthsearch"_cnc: return new PkmnLibAI::DepthSearchAI();
case "naive"_cnc: return new PkmnLibAI::NaiveAI();
default: throw ArbUt::Exception("Unknown AI name.");
}
}
};
#endif // PKMNLIB_AI_AIRESOLVER_HPP