11 #include "modules/once.h" 12 #include "scenariospecification.h" 45 virtual std::pair<std::shared_ptr<BasePlayer>, std::shared_ptr<BasePlayer>>
47 const std::function<
void(
BasePlayer*)>& setup1,
48 const std::function<
void(
BasePlayer*)>& setup2) = 0;
56 template <
typename TPlayer>
58 std::string
const& map,
62 std::string
const& replayPath = std::string()) {
63 game_ = std::make_shared<GameMultiPlayer>(
64 map, race1, race2, gameType, replayPath,
gui_);
76 std::shared_ptr<GameMultiPlayer>
game_;
GameType
Definition: gametype.h:12
ScenarioProvider & setMaxFrames(int value)
The maximum number of steps to play before considering a scenario finished Defaults to -1...
Definition: scenarioprovider.h:29
std::shared_ptr< BasePlayer > player2_
Definition: scenarioprovider.h:75
bool gui_
Definition: scenarioprovider.h:72
The main bot object.
Definition: baseplayer.h:28
virtual std::pair< std::shared_ptr< BasePlayer >, std::shared_ptr< BasePlayer > > startNewScenario(const std::function< void(BasePlayer *)> &setup1, const std::function< void(BasePlayer *)> &setup2)=0
Spawns a scenario.
std::shared_ptr< GameMultiPlayer > game_
Definition: scenarioprovider.h:76
virtual ~ScenarioProvider()=default
void loadMap(std::string const &map, tc::BW::Race race1, tc::BW::Race race2, GameType gameType, std::string const &replayPath=std::string())
Definition: scenarioprovider.h:57
Base class for providing scenarios.
Definition: scenarioprovider.h:23
Main namespace for bot-related code.
Definition: areainfo.cpp:17
int maxFrame_
Definition: scenarioprovider.h:71
std::shared_ptr< BasePlayer > player1_
Definition: scenarioprovider.h:74
ScenarioProvider & setGui(bool value)
Specifies whether to run OpenBW headfully.
Definition: scenarioprovider.h:37
virtual bool isFinished(int currentStep)
Check whether the scenario is finished.
Definition: scenarioprovider.cpp:13