Adding the max number of objects allowed
This commit is contained in:
parent
e575a51284
commit
f245f84601
2 changed files with 3 additions and 1 deletions
|
|
@ -45,6 +45,8 @@ namespace character {
|
||||||
|
|
||||||
static constexpr std::string_view json_key{ "billy_objects" };
|
static constexpr std::string_view json_key{ "billy_objects" };
|
||||||
|
|
||||||
|
static constexpr std::uint32_t max_obj{ 3 };
|
||||||
|
|
||||||
static std::string_view billy_object_to_string(const billyObjects &object) noexcept;
|
static std::string_view billy_object_to_string(const billyObjects &object) noexcept;
|
||||||
|
|
||||||
static void to_json(json &j, const container &billy);
|
static void to_json(json &j, const container &billy);
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ namespace character {
|
||||||
|
|
||||||
|
|
||||||
bool BillyObjects::insert_object(CharacterSheet &sheet, const billyEnums objType) noexcept {
|
bool BillyObjects::insert_object(CharacterSheet &sheet, const billyEnums objType) noexcept {
|
||||||
if (sheet.objects.size() < 3) {
|
if (sheet.objects.size() < max_obj) {
|
||||||
sheet.objects.emplace(objType,
|
sheet.objects.emplace(objType,
|
||||||
std::visit(overloaded{
|
std::visit(overloaded{
|
||||||
[](const weapons &arg) {
|
[](const weapons &arg) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue