2020-02-17 15:05:03 +00:00
|
|
|
#ifndef PKMNLIB_POKEMONPARTY_HPP
|
|
|
|
#define PKMNLIB_POKEMONPARTY_HPP
|
|
|
|
|
|
|
|
#include <CreatureLib/Battling/Models/CreatureParty.hpp>
|
|
|
|
#include "Pokemon.hpp"
|
|
|
|
namespace PkmnLib::Battling {
|
|
|
|
class PokemonParty : public CreatureLib::Battling::CreatureParty {
|
|
|
|
public:
|
2022-03-25 18:08:42 +00:00
|
|
|
PokemonParty(ArbUt::List<CreatureLib::Battling::Creature * nullable> party)
|
2020-02-17 15:05:03 +00:00
|
|
|
: CreatureLib::Battling::CreatureParty(std::move(party)) {}
|
2022-06-07 21:23:40 +00:00
|
|
|
PokemonParty(std::initializer_list<CreatureLib::Battling::Creature * nullable> party)
|
2020-02-17 15:05:03 +00:00
|
|
|
: CreatureLib::Battling::CreatureParty(party) {}
|
2021-04-11 14:27:21 +00:00
|
|
|
PokemonParty(size_t size) : CreatureLib::Battling::CreatureParty(size) {}
|
2020-02-17 15:05:03 +00:00
|
|
|
|
2021-05-08 10:12:36 +00:00
|
|
|
ArbUt::OptionalBorrowedPtr<Pokemon> GetAtIndex(size_t index) const {
|
2020-06-02 18:37:21 +00:00
|
|
|
return CreatureLib::Battling::CreatureParty::GetAtIndex(index).As<Pokemon>();
|
2020-02-17 15:05:03 +00:00
|
|
|
}
|
2021-04-11 14:27:21 +00:00
|
|
|
|
2022-03-25 18:08:42 +00:00
|
|
|
CreatureParty* non_null Clone() const override {
|
2021-04-11 14:27:21 +00:00
|
|
|
auto party = new PokemonParty(GetParty().Count());
|
|
|
|
auto i = 0;
|
|
|
|
for (auto c : GetParty()) {
|
|
|
|
if (c != nullptr) {
|
|
|
|
party->SwapInto(i, c->Clone());
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return party;
|
|
|
|
}
|
2020-02-17 15:05:03 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // PKMNLIB_POKEMONPARTY_HPP
|