From cbbf1f1353eb55ee459d40f77b765adaf70df401 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Wed, 25 Sep 2024 17:35:11 +0200 Subject: core: simplify participant property implementations --- core/include/turns/core/participant.hpp | 58 +++++++++++++++++---------------- 1 file changed, 30 insertions(+), 28 deletions(-) (limited to 'core') diff --git a/core/include/turns/core/participant.hpp b/core/include/turns/core/participant.hpp index a58e198..23d6211 100644 --- a/core/include/turns/core/participant.hpp +++ b/core/include/turns/core/participant.hpp @@ -24,34 +24,11 @@ namespace turns::core auto operator<=>(participant const & other) const noexcept -> std::partial_ordering; - auto defeated(this auto && self) - { - return self.m_defeated.get_proxy(); - } - - template - auto disposition(this Self && self) - { - return self.m_disposition.get_proxy(); - } - - template - auto is_active(this Self && self) - { - return self.m_is_active.get_proxy(); - } - - template - auto name(this Self && self) - { - return self.m_name.get_proxy(); - } - - template - auto priority(this Self && self) - { - return self.m_priority.get_proxy(); - } + auto defeated(this auto && self); + auto disposition(this auto && self); + auto is_active(this auto && self); + auto name(this auto && self); + auto priority(this auto && self); auto serialize() -> nlohmann::json; @@ -63,6 +40,31 @@ namespace turns::core Glib::Property m_priority{*this, "priority", 0.0f}; }; + auto participant::defeated(this auto && self) + { + return self.m_defeated.get_proxy(); + } + + auto participant::disposition(this auto && self) + { + return self.m_disposition.get_proxy(); + } + + auto participant::is_active(this auto && self) + { + return self.m_is_active.get_proxy(); + } + + auto participant::name(this auto && self) + { + return self.m_name.get_proxy(); + } + + auto participant::priority(this auto && self) + { + return self.m_priority.get_proxy(); + } + } // namespace turns::core #endif \ No newline at end of file -- cgit v1.2.3