Updates CreatureLib, implements ConstStrings.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2020-02-27 18:59:15 +01:00
parent d57b5852f1
commit 40a003429e
24 changed files with 214 additions and 202 deletions

View File

@@ -7,15 +7,15 @@ namespace PkmnLib::Battling {
class CreatePokemon {
private:
const BattleLibrary* _library;
std::string _species;
std::string _forme = "default";
Arbutils::CaseInsensitiveConstString _species;
Arbutils::CaseInsensitiveConstString _forme = "default"_cnc;
uint8_t _level;
std::string _nickname = "";
std::string _ability = "";
uint8_t _nature = 255;
CreatureLib::Library::Gender _gender = static_cast<CreatureLib::Library::Gender>(-1);
std::string _heldItem = "";
Arbutils::CaseInsensitiveConstString _heldItem = ""_cnc;
uint32_t _identifier = 0;
std::vector<std::tuple<const Library::MoveData*, CreatureLib::Battling::AttackLearnMethod>> _attacks = {};
@@ -37,16 +37,16 @@ namespace PkmnLib::Battling {
bool _isShiny = false;
public:
CreatePokemon(const BattleLibrary* library, std::string species, uint8_t level)
: _library(library), _species(std::move(species)), _level(level) {}
CreatePokemon(const BattleLibrary* library, const Arbutils::CaseInsensitiveConstString& species, uint8_t level)
: _library(library), _species(species), _level(level) {}
CreatePokemon* WithForme(const std::string& forme);
CreatePokemon* WithForme(const Arbutils::CaseInsensitiveConstString& forme);
CreatePokemon* WithGender(CreatureLib::Library::Gender gender);
CreatePokemon* IsShiny(bool value);
CreatePokemon* WithHeldItem(const std::string& item);
CreatePokemon* LearnMove(const std::string& move, CreatureLib::Battling::AttackLearnMethod method);
CreatePokemon* WithHeldItem(const Arbutils::CaseInsensitiveConstString& item);
CreatePokemon* LearnMove(const Arbutils::CaseInsensitiveConstString& move, CreatureLib::Battling::AttackLearnMethod method);
CreatePokemon* WithRandomIndividualValues(CreatureLib::Core::Random rand = CreatureLib::Core::Random());
CreatePokemon* WithRandomIndividualValues(Arbutils::Random rand = Arbutils::Random());
CreatePokemon* WithIndividualValue(CreatureLib::Core::Statistic stat, uint8_t value);
CreatePokemon* WithIndividualValues(uint8_t hp, uint8_t att, uint8_t def, uint8_t spAtt, uint8_t spDef,
uint8_t speed);