Initial commit.
This commit is contained in:
10
src/Library/Moves/MoveCategory.hpp
Normal file
10
src/Library/Moves/MoveCategory.hpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef PKMNLIB_MOVECATEGORY_HPP
|
||||
#define PKMNLIB_MOVECATEGORY_HPP
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace PkmnLib::Library {
|
||||
enum class MoveCategory : uint8_t { Physical, Special, Status };
|
||||
}
|
||||
|
||||
#endif // PKMNLIB_MOVECATEGORY_HPP
|
||||
12
src/Library/Moves/MoveData.cpp
Normal file
12
src/Library/Moves/MoveData.cpp
Normal file
@@ -0,0 +1,12 @@
|
||||
#include "MoveData.hpp"
|
||||
#include <unitypes.h>
|
||||
PkmnLib::Library::MoveData::MoveData(std::string name, std::string type, PkmnLib::Library::MoveCategory category,
|
||||
uint8_t power, uint8_t accuracy, uint8_t baseUsage,
|
||||
CreatureLib::Library::AttackTarget target, uint8_t priority,
|
||||
std::unordered_set<std::string> flags)
|
||||
: AttackData(name, type, static_cast<CreatureLib::Library::AttackCategory>(category), power, accuracy, baseUsage,
|
||||
target, priority, flags) {}
|
||||
|
||||
PkmnLib::Library::MoveCategory PkmnLib::Library::MoveData::GetCategory() const {
|
||||
return static_cast<PkmnLib::Library::MoveCategory>(AttackData::GetCategory());
|
||||
}
|
||||
21
src/Library/Moves/MoveData.hpp
Normal file
21
src/Library/Moves/MoveData.hpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef PKMNLIB_MOVEDATA_HPP
|
||||
#define PKMNLIB_MOVEDATA_HPP
|
||||
|
||||
#include <Library/Attacks/AttackData.hpp>
|
||||
#include <unitypes.h>
|
||||
#include "MoveCategory.hpp"
|
||||
|
||||
namespace PkmnLib::Library {
|
||||
class MoveData : public CreatureLib::Library::AttackData {
|
||||
private:
|
||||
|
||||
public:
|
||||
MoveData(std::string name, std::string type, PkmnLib::Library::MoveCategory category, uint8_t power,
|
||||
uint8_t accuracy, uint8_t baseUsage, CreatureLib::Library::AttackTarget target, uint8_t priority,
|
||||
std::unordered_set<std::string> flags);
|
||||
|
||||
PkmnLib::Library::MoveCategory GetCategory() const;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // PKMNLIB_MOVEDATA_HPP
|
||||
4
src/Library/Moves/MoveLibrary.cpp
Normal file
4
src/Library/Moves/MoveLibrary.cpp
Normal file
@@ -0,0 +1,4 @@
|
||||
#include "MoveLibrary.hpp"
|
||||
const CreatureLib::Library::AttackData* PkmnLib::Library::MoveLibrary::operator[](const std::string& name) const {
|
||||
return AttackLibrary::operator[](name);
|
||||
}
|
||||
12
src/Library/Moves/MoveLibrary.hpp
Normal file
12
src/Library/Moves/MoveLibrary.hpp
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef PKMNLIB_MOVELIBRARY_HPP
|
||||
#define PKMNLIB_MOVELIBRARY_HPP
|
||||
|
||||
#include <Library/AttackLibrary.hpp>
|
||||
namespace PkmnLib::Library {
|
||||
class MoveLibrary : public CreatureLib::Library::AttackLibrary {
|
||||
public:
|
||||
virtual const CreatureLib::Library::AttackData* operator[](const std::string& name) const;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // PKMNLIB_MOVELIBRARY_HPP
|
||||
1
src/Library/PokemonLibrary.cpp
Normal file
1
src/Library/PokemonLibrary.cpp
Normal file
@@ -0,0 +1 @@
|
||||
#include "PokemonLibrary.hpp"
|
||||
22
src/Library/PokemonLibrary.hpp
Normal file
22
src/Library/PokemonLibrary.hpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef PKMNLIB_POKEMONLIBRARY_HPP
|
||||
#define PKMNLIB_POKEMONLIBRARY_HPP
|
||||
|
||||
#include <Library/DataLibrary.hpp>
|
||||
#include "Species/SpeciesLibrary.hpp"
|
||||
|
||||
namespace PkmnLib::Library {
|
||||
class PokemonLibrary : public CreatureLib::Library::DataLibrary {
|
||||
public:
|
||||
PokemonLibrary(CreatureLib::Library::LibrarySettings settings, PkmnLib::Library::SpeciesLibrary* species,
|
||||
CreatureLib::Library::AttackLibrary* attacks, CreatureLib::Library::ItemLibrary* items,
|
||||
CreatureLib::Library::GrowthRateLibrary* growthRates,
|
||||
CreatureLib::Library::TypeLibrary* typeLibrary)
|
||||
: DataLibrary(settings, species, attacks, items, growthRates, typeLibrary) {}
|
||||
const PkmnLib::Library::SpeciesLibrary* GetSpeciesLibrary() const {
|
||||
return reinterpret_cast<const PkmnLib::Library::SpeciesLibrary*>(
|
||||
CreatureLib::Library::DataLibrary::GetSpeciesLibrary());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif // PKMNLIB_POKEMONLIBRARY_HPP
|
||||
7
src/Library/Species/PokemonForme.cpp
Normal file
7
src/Library/Species/PokemonForme.cpp
Normal file
@@ -0,0 +1,7 @@
|
||||
#include "PokemonForme.hpp"
|
||||
PkmnLib::Library::PokemonForme::PokemonForme(std::string name, float height, float weight, uint32_t baseExperience,
|
||||
std::vector<uint8_t> types,
|
||||
CreatureLib::Core::StatisticSet<uint16_t> baseStats,
|
||||
std::vector<std::string> talents, std::vector<std::string> secretTalents,
|
||||
const CreatureLib::Library::LearnableAttacks* attacks)
|
||||
: SpeciesVariant(name, height, weight, baseExperience, types, baseStats, talents, secretTalents, attacks) {}
|
||||
18
src/Library/Species/PokemonForme.hpp
Normal file
18
src/Library/Species/PokemonForme.hpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef PKMNLIB_POKEMONFORME_HPP
|
||||
#define PKMNLIB_POKEMONFORME_HPP
|
||||
|
||||
#include <Library/CreatureData/SpeciesVariant.hpp>
|
||||
|
||||
namespace PkmnLib::Library {
|
||||
class PokemonForme : public CreatureLib::Library::SpeciesVariant {
|
||||
public:
|
||||
PokemonForme(std::string name, float height, float weight, uint32_t baseExperience, std::vector<uint8_t> types,
|
||||
CreatureLib::Core::StatisticSet<uint16_t> baseStats, std::vector<std::string> talents,
|
||||
std::vector<std::string> secretTalents, const CreatureLib::Library::LearnableAttacks* attacks);
|
||||
|
||||
private:
|
||||
public:
|
||||
};
|
||||
}
|
||||
|
||||
#endif // PKMNLIB_POKEMONFORME_HPP
|
||||
1
src/Library/Species/PokemonSpecies.cpp
Normal file
1
src/Library/Species/PokemonSpecies.cpp
Normal file
@@ -0,0 +1 @@
|
||||
#include "PokemonSpecies.hpp"
|
||||
29
src/Library/Species/PokemonSpecies.hpp
Normal file
29
src/Library/Species/PokemonSpecies.hpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifndef PKMNLIB_POKEMONSPECIES_HPP
|
||||
#define PKMNLIB_POKEMONSPECIES_HPP
|
||||
#include <Battling/Models/Creature.hpp>
|
||||
#include "PokemonForme.hpp"
|
||||
|
||||
namespace PkmnLib::Library {
|
||||
class PokemonSpecies : public CreatureLib::Library::CreatureSpecies {
|
||||
private:
|
||||
uint8_t _baseHappiness;
|
||||
|
||||
public:
|
||||
PokemonSpecies(uint16_t id, const std::string& name, const PokemonForme* defaultVariant, float genderRatio,
|
||||
const std::string& growthRate, uint8_t captureRate, uint8_t baseHappiness)
|
||||
: CreatureSpecies(id, name, defaultVariant, genderRatio, growthRate, captureRate),
|
||||
_baseHappiness(baseHappiness) {}
|
||||
|
||||
inline uint8_t GetBaseHappiness() const { return _baseHappiness; }
|
||||
|
||||
inline const PokemonForme* GetDefaultForme() const {
|
||||
return reinterpret_cast<const PokemonForme*>(CreatureSpecies::GetVariant("default"));
|
||||
}
|
||||
|
||||
inline const PokemonForme* GetForme(const std::string& key) const {
|
||||
return reinterpret_cast<const PokemonForme*>(CreatureSpecies::GetVariant(key));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif // PKMNLIB_POKEMONSPECIES_HPP
|
||||
1
src/Library/Species/SpeciesLibrary.cpp
Normal file
1
src/Library/Species/SpeciesLibrary.cpp
Normal file
@@ -0,0 +1 @@
|
||||
#include "SpeciesLibrary.hpp"
|
||||
22
src/Library/Species/SpeciesLibrary.hpp
Normal file
22
src/Library/Species/SpeciesLibrary.hpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef PKMNLIB_SPECIESLIBRARY_HPP
|
||||
#define PKMNLIB_SPECIESLIBRARY_HPP
|
||||
|
||||
#include <Library/SpeciesLibrary.hpp>
|
||||
#include "PokemonSpecies.hpp"
|
||||
|
||||
namespace PkmnLib::Library {
|
||||
class SpeciesLibrary : public CreatureLib::Library::SpeciesLibrary {
|
||||
public:
|
||||
inline const PokemonSpecies* GetPkmnSpecies(const std::string& name) const {
|
||||
return reinterpret_cast<const PokemonSpecies*>(CreatureLib::Library::SpeciesLibrary::GetSpecies(name));
|
||||
}
|
||||
|
||||
const PokemonSpecies* operator[](const std::string& name) const { return GetPkmnSpecies(name); }
|
||||
|
||||
void LoadSpecies(const std::string& name, const PokemonSpecies* species){
|
||||
CreatureLib::Library::SpeciesLibrary::LoadSpecies(name, species);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif // PKMNLIB_SPECIESLIBRARY_HPP
|
||||
Reference in New Issue
Block a user