Start working on documentation.
continuous-integration/drone/push Build encountered an error Details

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
Deukhoofd 2020-09-25 18:24:28 +02:00
parent d4505f4293
commit 4bf591c649
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
4 changed files with 2596 additions and 12 deletions

View File

@ -4,6 +4,9 @@ name: default
volumes:
- name: conan-data
temp: { }
- name: docs
host:
path: /home/docs/CreatureLib
type: docker
steps:
@ -34,11 +37,6 @@ steps:
- cmake --build build-release --target all -- -j 4
- build-release/CreatureLibTests -s --durations yes --use-colour yes
- valgrind --tool=memcheck --gen-suppressions=all --leak-check=full --leak-resolution=med --track-origins=yes --vgdb=no --error-exitcode=1 build-release/CreatureLibTests ~\[Exception\]
- name: style-check
image: deukhoofd/linux64builder
failure: ignore
commands:
- run-clang-format.py -r src/ CInterface/ tests/ --color=always
- name: test-release-windows
image: deukhoofd/windowsbuilder
volumes:
@ -54,6 +52,11 @@ steps:
- cmake --build build-release-windows --target all -- -j 4
- export WINEARCH=win64
- wine build-release-windows/CreatureLibTests.exe -s
- name: style-check
image: deukhoofd/linux64builder
failure: ignore
commands:
- run-clang-format.py -r src/ CInterface/ tests/ --color=always
- name: conan-deploy
image: deukhoofd/linux64builder
volumes:
@ -75,3 +78,15 @@ steps:
- conan upload CreatureLib/$DRONE_COMMIT@epsilon/$DRONE_BRANCH --all -r=epsilon-public --force
- conan upload CreatureLib/latest@epsilon/$DRONE_BRANCH --all -r=epsilon-public
- conan user --clean
- name: documentation-publish
image: deukhoofd/linux64builder
when:
branch:
- master
volumes:
- name: docs
path: /docs
commands:
- rm -rf /docs
- wget https://documentation.p-epsilon.com/Arbutils/Arbutils.tag Arbutils.tag
- ( cat Doxyfile ; echo "OUTPUT_DIRECTORY=/docs"; echo "GENERATE_TAGFILE=/docs/html/CreatureLib.tag" ) | doxygen -

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
/cmake-build-release/
/build-release-windows/
/.idea/
/docs/

2533
Doxyfile Normal file

File diff suppressed because it is too large Load Diff

View File

@ -5,30 +5,65 @@
#include "SpeciesVariant.hpp"
namespace CreatureLib::Library {
/*!
\brief This holds the data required for a species of a creature, so the general data we can describe different
creatures with.
*/
/// @brief This holds the data required for a species of a creature, so the general data we can describe different
// creatures with.
class CreatureSpecies {
struct impl;
std::unique_ptr<impl> _impl;
public:
/// @brief Instantiates a CreatureSpecies.
/// @param id The unique id of the creature species.
/// @param name The name of the creature species. This should generally not be its display name.
/// @param defaultVariant The variant the creature species has by default.
/// @param genderRatio The ratio at which a creature species is male or female. 0 is always female, 1 is always
/// male. -1 makes the creature genderless.
/// @param growthRate The name of the growthrate this creature species should follow. These should be defined in
/// the growthrate library.
/// @param captureRate The chance to capture the creature species, between 0 and 255. 255 means instant capture,
/// 0 means impossible to capture.
/// @param flags A set of flags for use by the developer. These can be used for easy grouping.
CreatureSpecies(uint16_t id, const ArbUt::StringView& name, const SpeciesVariant* defaultVariant,
float genderRatio, const ArbUt::StringView& growthRate, uint8_t captureRate,
std::unordered_set<uint32_t> flags = {});
virtual ~CreatureSpecies();
/// @brief Returns the unique id of the creature species.
/// @return The unique id of the creature species
uint16_t GetId() const noexcept;
/// @brief Returns the gender rate of the creature species.
/// @return The gender rate of the creature species. 0 is always female, 1 is always male. -1 makes the creature
/// genderless.
float GetGenderRate() const noexcept;
/// @brief Returns the growthrate name of the creature species, as defined in the growthrate library.
/// @return The growthrate name of the creature species, as defined in the growthrate library.
const ArbUt::StringView& GetGrowthRate() const noexcept;
/// @brief Returns the capture rate of the creature species.
/// @return The base capture rate of the creature species. 255 means instant capture, 0 means impossible to
/// capture.
uint8_t GetCaptureRate() const noexcept;
/// @brief Checks whether the species contains a variant with a specific name.
/// @param key The name of the variant that's being looked for.
/// @return True if the species contains the variant, false otherwise.
[[nodiscard]] bool HasVariant(const ArbUt::BasicStringView& key) const noexcept;
/// @brief Checks whether the species contains a variant with a specific name.
/// @param hash The string hash of the variant that's being looked for. This hash can be retrieved from the
/// StringView class.
/// @return True if the species contains the variant, false otherwise.
[[nodiscard]] bool HasVariant(uint32_t hash) const noexcept;
/// @brief Try to get a variant of the species with a specific name.
/// @param name The name of the variant that's being looked for.
/// @param out If a variant is found, it will be put in this variable. If not, this will remain unchanged.
/// @return True if the species contains the variant, false otherwise.
[[nodiscard]] bool TryGetVariant(const ArbUt::BasicStringView& name,
ArbUt::BorrowedPtr<const SpeciesVariant>& out) const noexcept;
/// @brief Try to get a variant of the species with a specific name.
/// @param name The string hash of the variant that's being looked for. This hash can be retrieved from the
/// StringView class.
/// @param out If a variant is found, it will be put in this variable. If not, this will remain unchanged.
/// @return True if the species contains the variant, false otherwise.
[[nodiscard]] bool TryGetVariant(uint32_t hash, ArbUt::BorrowedPtr<const SpeciesVariant>& out) const noexcept;
[[nodiscard]] ArbUt::BorrowedPtr<const SpeciesVariant> GetVariant(const ArbUt::BasicStringView& key) const;
[[nodiscard]] ArbUt::BorrowedPtr<const SpeciesVariant> GetVariant(uint32_t key) const;