summaryrefslogtreecommitdiff
path: root/core/include
diff options
context:
space:
mode:
Diffstat (limited to 'core/include')
-rw-r--r--core/include/turns/core/disposition.hpp39
-rw-r--r--core/include/turns/core/fwd.hpp14
-rw-r--r--core/include/turns/core/init.hpp11
-rw-r--r--core/include/turns/core/participant.hpp82
4 files changed, 0 insertions, 146 deletions
diff --git a/core/include/turns/core/disposition.hpp b/core/include/turns/core/disposition.hpp
deleted file mode 100644
index cd00836..0000000
--- a/core/include/turns/core/disposition.hpp
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef TURNS_CORE_DISPOSITION_HPP
-#define TURNS_CORE_DISPOSITION_HPP
-
-#include <glibmm/ustring.h>
-#include <glibmm/value.h>
-
-#include <glib-object.h>
-
-#include <cstdint>
-
-namespace turns::core
-{
- enum struct Disposition : std::uint8_t
- {
- Neutral,
- Friendly,
- Hostile,
- Secret,
-
- ///! End marker
- END
- };
-
- auto presentation_name_for(Disposition value) -> Glib::ustring;
-} // namespace turns::core
-
-namespace Glib
-{
- template<>
- class Value<turns::core::Disposition> : public Glib::Value_Enum<turns::core::Disposition>
- {
- GType static constinit inline gtype_{};
-
- public:
- auto static value_type() -> GType;
- };
-} // namespace Glib
-
-#endif \ No newline at end of file
diff --git a/core/include/turns/core/fwd.hpp b/core/include/turns/core/fwd.hpp
deleted file mode 100644
index c006084..0000000
--- a/core/include/turns/core/fwd.hpp
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef TURNS_CORE_FWD_HPP
-#define TURNS_CORE_FWD_HPP
-
-#include <cstdint>
-
-namespace turns::core
-{
- enum struct Disposition : std::uint8_t;
-
- struct Participant;
- struct TurnOderModel;
-} // namespace turns::core
-
-#endif \ No newline at end of file
diff --git a/core/include/turns/core/init.hpp b/core/include/turns/core/init.hpp
deleted file mode 100644
index f0dc70e..0000000
--- a/core/include/turns/core/init.hpp
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef TURNS_CORE_INIT_HPP
-#define TURNS_CORE_INIT_HPP
-
-namespace turns::core
-{
-
- auto register_types() -> void;
-
-} // namespace turns::core
-
-#endif \ No newline at end of file
diff --git a/core/include/turns/core/participant.hpp b/core/include/turns/core/participant.hpp
deleted file mode 100644
index e6d9008..0000000
--- a/core/include/turns/core/participant.hpp
+++ /dev/null
@@ -1,82 +0,0 @@
-#ifndef TURNS_CORE_PARTICIPANT_HPP
-#define TURNS_CORE_PARTICIPANT_HPP
-
-#include "turns/core/disposition.hpp"
-
-#include <glibmm/object.h>
-#include <glibmm/property.h>
-#include <glibmm/refptr.h>
-#include <glibmm/ustring.h>
-
-#include <nlohmann/json_fwd.hpp>
-
-#include <compare>
-
-namespace turns::core
-{
- struct Participant : Glib::Object
- {
- auto static create(Glib::ustring name, float priority, Disposition disposition) -> Glib::RefPtr<Participant>;
- auto static create(nlohmann::json const & serialized) -> Glib::RefPtr<Participant>;
-
- Participant();
- Participant(Glib::ustring name, float priority, Disposition disposition);
-
- auto operator<=>(Participant const & other) const noexcept -> std::partial_ordering;
-
- [[nodiscard]] auto get_disposition() const -> Disposition;
- [[nodiscard]] auto get_is_active() const -> bool;
- [[nodiscard]] auto get_is_defeated() const -> bool;
- [[nodiscard]] auto get_name() const -> Glib::ustring;
- [[nodiscard]] auto get_priority() const -> float;
-
- auto set_disposition(Disposition value) -> void;
- auto set_is_active(bool value) -> void;
- auto set_is_defeated(bool value) -> void;
- auto set_name(Glib::ustring const & value) -> void;
- auto set_priority(float value) -> void;
-
- [[nodiscard]] auto property_disposition(this auto && self);
- [[nodiscard]] auto property_is_active(this auto && self);
- [[nodiscard]] auto property_is_defeated(this auto && self);
- [[nodiscard]] auto property_name(this auto && self);
- [[nodiscard]] auto property_priority(this auto && self);
-
- auto serialize() -> nlohmann::json;
-
- private:
- Glib::Property<core::Disposition> m_disposition{*this, "disposition", core::Disposition::Neutral};
- Glib::Property<bool> m_is_active{*this, "is-active", false};
- Glib::Property<bool> m_is_defeated{*this, "is-defeated", false};
- Glib::Property<Glib::ustring> m_name{*this, "name", ""};
- Glib::Property<float> m_priority{*this, "priority", 0.0f};
- };
-
- auto Participant::property_disposition(this auto && self)
- {
- return self.m_disposition.get_proxy();
- }
-
- auto Participant::property_is_active(this auto && self)
- {
- return self.m_is_active.get_proxy();
- }
-
- auto Participant::property_is_defeated(this auto && self)
- {
- return self.m_is_defeated.get_proxy();
- }
-
- auto Participant::property_name(this auto && self)
- {
- return self.m_name.get_proxy();
- }
-
- auto Participant::property_priority(this auto && self)
- {
- return self.m_priority.get_proxy();
- }
-
-} // namespace turns::core
-
-#endif \ No newline at end of file