diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2024-09-25 18:22:37 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2024-09-25 18:22:37 +0200 |
| commit | ca3326e09a30181127a3e49985538ef424b5e612 (patch) | |
| tree | 345eba9cb6ad06fbe969f6852907cfc11b86cd39 /core/src | |
| parent | 4c5d17bc8e6fceeb6fd9cc45c10f07b7bc639f49 (diff) | |
| download | turns-ca3326e09a30181127a3e49985538ef424b5e612.tar.xz turns-ca3326e09a30181127a3e49985538ef424b5e612.zip | |
core: rename property accessors of participant
Diffstat (limited to 'core/src')
| -rw-r--r-- | core/src/participant.cpp | 4 | ||||
| -rw-r--r-- | core/src/turn_order.cpp | 14 |
2 files changed, 9 insertions, 9 deletions
diff --git a/core/src/participant.cpp b/core/src/participant.cpp index b607794..d560789 100644 --- a/core/src/participant.cpp +++ b/core/src/participant.cpp @@ -28,8 +28,8 @@ namespace turns::core auto name = serialized.value("name", std::string{}); auto instance = create(name, priority, disposition); - instance->is_active() = serialized.value("is-active", false); - instance->is_defeated() = serialized.value("is-defeated", false);; + instance->property_is_active() = serialized.value("is-active", false); + instance->property_is_defeated() = serialized.value("is-defeated", false);; return instance; } diff --git a/core/src/turn_order.cpp b/core/src/turn_order.cpp index a2c4ce5..d43ac7f 100644 --- a/core/src/turn_order.cpp +++ b/core/src/turn_order.cpp @@ -103,7 +103,7 @@ namespace turns::core auto turn_order::add(Glib::ustring const & name, float priority, disposition disposition) -> void { auto entry = participant::create(name, priority, disposition); - entry->priority().signal_changed().connect(sigc::bind(sigc::mem_fun(*this, &turn_order::handle_priority_changed), entry)); + entry->property_priority().signal_changed().connect(sigc::bind(sigc::mem_fun(*this, &turn_order::handle_priority_changed), entry)); auto position = std::distance(m_data.cbegin(), insert(entry)); items_changed(position, 0, 1); @@ -135,8 +135,8 @@ namespace turns::core m_active = m_active.transform([this](auto index) { return (index + 1) % get_n_items(); }); m_has_previous = true; - m_data[old_active]->is_active() = false; - m_data[*m_active]->is_active() = true; + m_data[old_active]->property_is_active() = false; + m_data[*m_active]->property_is_active() = true; m_progress = (static_cast<float>(*m_active) + 1) / get_n_items(); @@ -157,8 +157,8 @@ namespace turns::core m_active = m_active.transform([this](auto index) { return index ? index - 1 : get_n_items() - 1; }); m_has_previous = m_round_number > 0 || m_active > 0; - m_data[old_active]->is_active() = false; - m_data[*m_active]->is_active() = true; + m_data[old_active]->property_is_active() = false; + m_data[*m_active]->property_is_active() = true; m_progress = (static_cast<float>(*m_active) + 1) / get_n_items(); @@ -191,7 +191,7 @@ namespace turns::core if (!m_active) { m_active = 0; - m_data[*m_active]->is_active() = true; + m_data[*m_active]->property_is_active() = true; } if (m_round_number == invalid_round_number) { @@ -225,7 +225,7 @@ namespace turns::core auto inserter = std::bind(&turn_order::insert, this, _1); std::ranges::for_each(participants | std::views::transform(factory), inserter); - auto active = std::ranges::find_if(m_data, [](auto participant) { return participant->is_active(); }); + auto active = std::ranges::find_if(m_data, [](auto participant) { return participant->property_is_active(); }); if (active != std::ranges::end(m_data)) { m_active = std::ranges::distance(std::ranges::begin(m_data), active); |
