14 #ifdef PEOPLEMON_DEBUG
15 const bool skip = debug::DebugOverrides::get().skipBattles;
17 const bool skip =
false;
28 BL_LOG_ERROR <<
"Unknown battle type: " << type;
34 Battle::Battle(bl::engine::Engine& engine,
const std::string& location, system::Player& player,
39 , state(typeToStage(type))
40 , view(engine, state, type ==
Type::WildPeoplemon) {}
42 std::unique_ptr<Battle> Battle::create(bl::engine::Engine& engine,
const std::string& location,
44 std::unique_ptr<Battle> b(
new Battle(engine, location, player, type));
46 std::vector<pplmn::BattlePeoplemon> team;
48 for (
auto& ppl : player.
state().
peoplemon) { team.emplace_back(&ppl); }
49 b->state.localPlayer().init(std::move(team),
50 std::make_unique<PlayerController>(player, b->view.menu()));
55 void Battle::setController(std::unique_ptr<BattleController>&& c) {
57 controller->init(*
this, view, state);
Type
The type classification of an item. This is used to determine when an item may be used and how to use...
Core classes and functionality for both the editor and game.
Convenience struct that owns all the components required for a battle and resolves some boilerplate s...
Type
Represents the different types of battles. Affects only the intro.
Stage
Represents all possible states in a battle.
std::vector< pplmn::OwnedPeoplemon > peoplemon
Primary system for managing the player and their data.
player::State & state()
Returns the state of the player.