diff --git a/include/billy_objects.hpp b/include/billy_objects.hpp index 5b9b9c7..3cc3698 100644 --- a/include/billy_objects.hpp +++ b/include/billy_objects.hpp @@ -45,8 +45,9 @@ namespace character { class BillyObjects final { public: + static constexpr std::size_t max_num_obj{ 3 }; using billyObject = std::variant; - using container = ankerl::svector; + using container = ankerl::svector; static constexpr std::string_view sword{ "Sword" }; static constexpr std::string_view lance{ "Lance" }; @@ -69,12 +70,9 @@ namespace character { void pop_object(CharacterSheet &sheet) noexcept; - [[nodiscard]] const container &get_objects() const noexcept { return objects; } - // void insert_weapon(weapons weapon, CharacterSheet &sheet) noexcept; private: - container objects; std::plus plus; std::minus minus; diff --git a/src/billy_objects.cpp b/src/billy_objects.cpp index ad4146e..45293ec 100644 --- a/src/billy_objects.cpp +++ b/src/billy_objects.cpp @@ -9,8 +9,8 @@ namespace character { using characteristic::Characteristic; void BillyObjects::push_object(const billyObject &object, CharacterSheet &sheet) noexcept { - if (objects.size() < 3) { - objects.emplace_back(object); + if (sheet.objects.size() < 3) { + sheet.objects.emplace_back(object); auto &local_habilete = static_cast(sheet.habilete); auto &local_adresse = static_cast(sheet.adresse); @@ -48,9 +48,9 @@ namespace character { } void BillyObjects::pop_object(CharacterSheet &sheet) noexcept { - if (!objects.empty()) { - const billyObject obj = objects.back(); - objects.pop_back(); + if (!sheet.objects.empty()) { + const billyObject obj = sheet.objects.back(); + sheet.objects.pop_back(); auto &local_habilete = static_cast(sheet.habilete); auto &local_adresse = static_cast(sheet.adresse);