Update to newer CreatureLib.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-07-04 15:50:30 +02:00
parent 698bc62b47
commit 7f1bc252ba
49 changed files with 207 additions and 237 deletions

View File

@@ -7,15 +7,15 @@ namespace PkmnLib::Battling {
class CreatePokemon {
private:
ArbUt::BorrowedPtr<const BattleLibrary> _library;
ArbUt::CaseInsensitiveConstString _species = ""_cnc;
ArbUt::CaseInsensitiveConstString _forme = "default"_cnc;
ArbUt::StringView _species = ""_cnc;
ArbUt::StringView _forme = "default"_cnc;
uint8_t _level;
std::string _nickname = "";
ArbUt::CaseInsensitiveConstString _ability = ""_cnc;
ArbUt::CaseInsensitiveConstString _nature;
ArbUt::StringView _ability = ""_cnc;
ArbUt::StringView _nature;
CreatureLib::Library::Gender _gender = static_cast<CreatureLib::Library::Gender>(-1);
ArbUt::CaseInsensitiveConstString _heldItem = ""_cnc;
ArbUt::StringView _heldItem = ""_cnc;
uint32_t _identifier = 0;
struct ToLearnMethod {
@@ -48,16 +48,15 @@ namespace PkmnLib::Battling {
bool _allowedExperienceGain = true;
public:
CreatePokemon(const BattleLibrary* library, const ArbUt::CaseInsensitiveConstString& species, uint8_t level)
CreatePokemon(const BattleLibrary* library, const ArbUt::StringView& species, uint8_t level)
: _library(library), _species(species), _level(level), _attacks(library->GetSettings()->GetMaximalMoves()) {
}
CreatePokemon WithForme(const ArbUt::CaseInsensitiveConstString& forme);
CreatePokemon WithForme(const ArbUt::StringView& forme);
CreatePokemon WithGender(CreatureLib::Library::Gender gender);
CreatePokemon IsShiny(bool value);
CreatePokemon WithHeldItem(const ArbUt::CaseInsensitiveConstString& item);
CreatePokemon LearnMove(const ArbUt::CaseInsensitiveConstString& move,
CreatureLib::Battling::AttackLearnMethod method);
CreatePokemon WithHeldItem(const ArbUt::StringView& item);
CreatePokemon LearnMove(const ArbUt::StringView& move, CreatureLib::Battling::AttackLearnMethod method);
CreatePokemon WithRandomIndividualValues(ArbUt::Random rand = ArbUt::Random());
CreatePokemon WithIndividualValue(CreatureLib::Library::Statistic stat, uint8_t value);
@@ -67,7 +66,7 @@ namespace PkmnLib::Battling {
CreatePokemon WithEffortValues(uint8_t hp, uint8_t att, uint8_t def, uint8_t spAtt, uint8_t spDef,
uint8_t speed);
CreatePokemon WithNature(const ArbUt::CaseInsensitiveConstString& nature);
CreatePokemon WithNature(const ArbUt::StringView& nature);
CreatePokemon IsAllowedExperienceGain(bool value);
Pokemon* Build();