diff --git a/include/billy_objects.hpp b/include/billy_objects.hpp index f0f4260..6759631 100644 --- a/include/billy_objects.hpp +++ b/include/billy_objects.hpp @@ -64,7 +64,7 @@ namespace character { static std::string_view billy_object_to_string(const billyObject &object) noexcept; - void add_object(const billyObject &object, CharacterSheet &sheet) noexcept; + void push_object(const billyObject &object, CharacterSheet &sheet) noexcept; void insert_weapon(weapons weapon, CharacterSheet &sheet) noexcept; @@ -74,8 +74,8 @@ namespace character { std::minus minus; std::uint8_t end_object{ 0 }; - static void change_carac_weapon(CharacterSheet &sheet, - const weapons &arg, + static void change_carac_weapon(const weapons &arg, + CharacterSheet &sheet, characteristic::Characteristic &localHabilete, characteristic::Characteristic &localAdresse, characteristic::Characteristic &localEndurance, diff --git a/src/billy_objects.cpp b/src/billy_objects.cpp index 914c380..0610c12 100644 --- a/src/billy_objects.cpp +++ b/src/billy_objects.cpp @@ -8,9 +8,10 @@ namespace character { using characteristic::Characteristic; - void BillyObjects::add_object(const billyObject &object, CharacterSheet &sheet) noexcept { + void BillyObjects::push_object(const billyObject &object, CharacterSheet &sheet) noexcept { if (end_object < 3) { objects.at(end_object) = object; + ++end_object; auto &local_habilete = static_cast(sheet.habilete); auto &local_adresse = static_cast(sheet.adresse); @@ -20,7 +21,7 @@ namespace character { std::visit(overloaded{ [&](const weapons &arg) { ++sheet.nb_weapons; - change_carac_weapon(sheet, arg, local_habilete, local_adresse, local_endurance, plus); + change_carac_weapon(arg, sheet, local_habilete, local_adresse, local_endurance, plus); }, [&](const equipments &arg) { ++sheet.nb_equipments; @@ -101,8 +102,8 @@ namespace character { } } - void BillyObjects::change_carac_weapon(CharacterSheet &sheet, - const weapons &arg, + void BillyObjects::change_carac_weapon(const weapons &arg, + CharacterSheet &sheet, Characteristic &localHabilete, Characteristic &localAdresse, Characteristic &localEndurance,