diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2024-09-25 18:21:09 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2024-09-25 18:21:09 +0200 |
| commit | 4c5d17bc8e6fceeb6fd9cc45c10f07b7bc639f49 (patch) | |
| tree | bc70b691cae584464b214f11f3972423b3943565 /core/src | |
| parent | cbbf1f1353eb55ee459d40f77b765adaf70df401 (diff) | |
| download | turns-4c5d17bc8e6fceeb6fd9cc45c10f07b7bc639f49.tar.xz turns-4c5d17bc8e6fceeb6fd9cc45c10f07b7bc639f49.zip | |
core: add "is-" prefix to "::active" and "::defeated"
Diffstat (limited to 'core/src')
| -rw-r--r-- | core/src/participant.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/core/src/participant.cpp b/core/src/participant.cpp index 3aadc80..b607794 100644 --- a/core/src/participant.cpp +++ b/core/src/participant.cpp @@ -23,15 +23,13 @@ namespace turns::core auto participant::create(nlohmann::json const & serialized) -> Glib::RefPtr<participant> { - auto active = serialized.value("active", false); auto disposition = serialized.value("disposition", disposition::neutral); auto priority = serialized.value("priority", 0.0f); auto name = serialized.value("name", std::string{}); - auto defeated = serialized.value("defeated", false); auto instance = create(name, priority, disposition); - instance->defeated() = defeated; - instance->is_active() = active; + instance->is_active() = serialized.value("is-active", false); + instance->is_defeated() = serialized.value("is-defeated", false);; return instance; } @@ -58,9 +56,9 @@ namespace turns::core auto participant::serialize() -> nlohmann::json { return nlohmann::json{ - {"active", m_is_active }, - {"defeated", m_defeated }, {"disposition", m_disposition}, + {"is-active", m_is_active }, + {"is-defeated", m_is_defeated}, {"name", m_name }, {"priority", m_priority }, }; |
