Add PokemonParty class.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-02-17 16:05:03 +01:00
parent f9f83f892d
commit 6fff01a994
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
2 changed files with 22 additions and 1 deletions

View File

@ -44,7 +44,7 @@ class PkmnLibConan(ConanFile):
self.options["AngelScript"].link_std_statically = True self.options["AngelScript"].link_std_statically = True
def requirements(self): def requirements(self):
self.requires("CreatureLib/da90c3d59e9b270b973bd52db24c38c14b298655@creaturelib/master") self.requires("CreatureLib/75bce0e32956193699145c4896288b1870c23677@creaturelib/master")
if self.options.script_handler == "angelscript": if self.options.script_handler == "angelscript":
self.requires("AngelScript/2.34@AngelScript/Deukhoofd") self.requires("AngelScript/2.34@AngelScript/Deukhoofd")
else: else:

View File

@ -0,0 +1,21 @@
#ifndef PKMNLIB_POKEMONPARTY_HPP
#define PKMNLIB_POKEMONPARTY_HPP
#include <CreatureLib/Battling/Models/CreatureParty.hpp>
#include <utility>
#include "Pokemon.hpp"
namespace PkmnLib::Battling {
class PokemonParty : public CreatureLib::Battling::CreatureParty {
public:
PokemonParty(std::vector<CreatureLib::Battling::Creature*> party)
: CreatureLib::Battling::CreatureParty(std::move(party)) {}
PokemonParty(std::initializer_list<CreatureLib::Battling::Creature*> party)
: CreatureLib::Battling::CreatureParty(party) {}
Pokemon* GetAtIndex(int index) const {
return dynamic_cast<Pokemon*>(CreatureLib::Battling::CreatureParty::GetAtIndex(index));
}
};
}
#endif // PKMNLIB_POKEMONPARTY_HPP