12 #include <torchcraft/client.h> 34 template <
typename T,
typename... Args>
35 static std::shared_ptr<T>
make(Args&&... args) {
36 auto m = std::make_shared<T>(std::forward<Args>(args)...);
37 if (m->name().empty()) {
42 static std::shared_ptr<Module>
make(std::string
const& typeName);
50 static std::string
makeName(std::type_index
const& type);
Game state.
Definition: state.h:42
static std::shared_ptr< T > make(Args &&...args)
Definition: module.h:35
void setName(std::string name)
Definition: module.cpp:37
The main bot object.
Definition: baseplayer.h:28
std::string name()
Definition: module.cpp:41
virtual void onGameEnd(State *s)
Definition: module.h:54
virtual void step(State *s)
Definition: module.h:52
Module()
Definition: module.cpp:18
std::string name_
Definition: module.h:60
virtual ~Module()=default
Main namespace for bot-related code.
Definition: areainfo.cpp:17
BasePlayer * player_
Definition: module.h:59
virtual void onGameStart(State *s)
Definition: module.h:53
virtual void setPlayer(BasePlayer *p)
Definition: module.h:44
Interface for bot modules.
Definition: module.h:30
static std::string makeName(std::type_index const &type)
Definition: module.cpp:45