diff --git a/include/billy_objects.hpp b/include/billy_objects.hpp index 2d2e7d2..6f8462b 100644 --- a/include/billy_objects.hpp +++ b/include/billy_objects.hpp @@ -11,13 +11,14 @@ #include #include #include -#include -#include "characteristic/characteristic.hpp" #include "generic_object.hpp" namespace character { class CharacterSheet; + namespace characteristic{ + class Characteristic; + } class BillyObjects final { public: diff --git a/include/character_sheet.hpp b/include/character_sheet.hpp index 8fd3dec..c9ec58a 100644 --- a/include/character_sheet.hpp +++ b/include/character_sheet.hpp @@ -1,7 +1,7 @@ #ifndef BILLYSHEET_CHARACTER_SHEET_HPP #define BILLYSHEET_CHARACTER_SHEET_HPP -#include "characteristic/characteristic.hpp" +#include "characteristic.hpp" #include "billy_objects.hpp" #include diff --git a/include/characteristic/characteristic.hpp b/include/characteristic.hpp similarity index 100% rename from include/characteristic/characteristic.hpp rename to include/characteristic.hpp diff --git a/include/generic_object.hpp b/include/generic_object.hpp index 3c5aa94..56d5fb0 100644 --- a/include/generic_object.hpp +++ b/include/generic_object.hpp @@ -9,7 +9,6 @@ #include #include #include -#include "characteristic/characteristic.hpp" // helper type for the visitor template @@ -18,6 +17,10 @@ template overloaded(Ts...) -> overloaded; namespace character { + namespace characteristic { + enum class characType : std::uint8_t; + } + using namespace std::string_literals; enum class weapons : std::uint8_t { @@ -59,7 +62,7 @@ namespace character { [[nodiscard]] virtual std::uint32_t add_damage() const noexcept = 0; - [[nodiscard]] virtual std::int32_t add_materiel(const characteristic::characType inType) const noexcept = 0; + [[nodiscard]] virtual std::int32_t add_materiel(const characteristic::characType &inType) const noexcept = 0; [[nodiscard]] virtual std::string_view to_string() const noexcept = 0; @@ -84,7 +87,7 @@ namespace character { [[nodiscard]] std::uint32_t add_damage() const noexcept final; - [[nodiscard]] std::int32_t add_materiel(const characteristic::characType inType) const noexcept final; + [[nodiscard]] std::int32_t add_materiel(const characteristic::characType &inType) const noexcept final; [[nodiscard]] std::string_view to_string() const noexcept final; @@ -107,7 +110,7 @@ namespace character { [[nodiscard]] std::uint32_t add_damage() const noexcept final; - [[nodiscard]] std::int32_t add_materiel(const characteristic::characType inType) const noexcept final; + [[nodiscard]] std::int32_t add_materiel(const characteristic::characType &inType) const noexcept final; [[nodiscard]] std::string_view to_string() const noexcept final; @@ -130,7 +133,7 @@ namespace character { [[nodiscard]] std::uint32_t add_damage() const noexcept final; - [[nodiscard]] std::int32_t add_materiel(const characteristic::characType inType) const noexcept final; + [[nodiscard]] std::int32_t add_materiel(const characteristic::characType &inType) const noexcept final; [[nodiscard]] std::string_view to_string() const noexcept final; diff --git a/src/billy_objects.cpp b/src/billy_objects.cpp index 395600f..d2d40f4 100644 --- a/src/billy_objects.cpp +++ b/src/billy_objects.cpp @@ -1,9 +1,5 @@ -// -// Created by postaron on 23/02/24. -// #include "billy_objects.hpp" -#include -#include "characteristic/characteristic.hpp" +#include "characteristic.hpp" #include "character_sheet.hpp" std::uint32_t constexpr const_hash(const char *input) { diff --git a/src/character_sheet.cpp b/src/character_sheet.cpp deleted file mode 100644 index aae9853..0000000 --- a/src/character_sheet.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "character_sheet.hpp" diff --git a/src/generic_object.cpp b/src/generic_object.cpp index 5bc6bc9..c0536df 100644 --- a/src/generic_object.cpp +++ b/src/generic_object.cpp @@ -3,6 +3,7 @@ // #include "generic_object.hpp" +#include "characteristic.hpp" namespace character { using characteristic::characType; @@ -30,7 +31,7 @@ namespace character { std::uint32_t Weapons::add_damage() const noexcept { return type == weapons::Morgenstern ? 1 : 0; } - std::int32_t Weapons::add_materiel(const characteristic::characType inType) const noexcept { + std::int32_t Weapons::add_materiel(const characteristic::characType &inType) const noexcept { switch (type) { case weapons::Sword: if (inType == characType::Habilete) { @@ -93,7 +94,7 @@ namespace character { std::uint32_t Equipments::add_damage() const noexcept { return 0; } - std::int32_t Equipments::add_materiel(const characteristic::characType inType) const noexcept { + std::int32_t Equipments::add_materiel(const characteristic::characType &inType) const noexcept { switch (type) { case equipments::Chainmail: if (inType == characType::Habilete || @@ -129,7 +130,7 @@ namespace character { std::uint32_t Tools::add_damage() const noexcept { return 0; } - std::int32_t Tools::add_materiel(const characteristic::characType inType) const noexcept { + std::int32_t Tools::add_materiel(const characteristic::characType &inType) const noexcept { switch (type) { case tools::Fourche: switch (inType) {