From 9ba06c686fd8636d488a4c2bda4e46b08936c167 Mon Sep 17 00:00:00 2001 From: Pcornat Date: Fri, 6 Feb 2026 15:11:47 +0100 Subject: [PATCH] Method to check if it is full of objects --- include/billy_objects.hpp | 2 ++ src/billy_objects.cpp | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/include/billy_objects.hpp b/include/billy_objects.hpp index 2dd3371..46152e9 100644 --- a/include/billy_objects.hpp +++ b/include/billy_objects.hpp @@ -57,6 +57,8 @@ namespace character { [[nodiscard]] bool erase_object(CharacterSheet &sheet, const billyEnums objToErase) noexcept; + [[nodiscard]] static bool is_full(const CharacterSheet &sheet) noexcept; + [[nodiscard]] const std::plus &get_plus_operation() const { return plus; } [[nodiscard]] const std::minus &get_minus_operation() const { return minus; } diff --git a/src/billy_objects.cpp b/src/billy_objects.cpp index 7592c17..52cf96d 100644 --- a/src/billy_objects.cpp +++ b/src/billy_objects.cpp @@ -80,6 +80,10 @@ namespace character { return false; } + bool BillyObjects::is_full(const CharacterSheet &sheet) noexcept { + return sheet.get_objects().size() >= max_obj; + } + void BillyObjects::change_carac(const billyObjects &arg, CharacterSheet &sheet, Characteristic &localHabilete,