PkmnLib/src/Battling/Pokemon/PokemonParty.hpp

34 lines
1.2 KiB
C++
Raw Normal View History

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:
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) {}
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 {
return CreatureLib::Battling::CreatureParty::GetAtIndex(index).As<Pokemon>();
2020-02-17 15:05:03 +00:00
}
CreatureParty* non_null Clone() const override {
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