From 457cdf24489c20f0f9b9b9877bf9e875aa643f91 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 8 Apr 2024 11:16:28 +0200 Subject: wip --- src/script.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/script.cpp (limited to 'src/script.cpp') diff --git a/src/script.cpp b/src/script.cpp new file mode 100644 index 00000000..57df6e58 --- /dev/null +++ b/src/script.cpp @@ -0,0 +1,26 @@ +#include "script.inl" +#include + +namespace floormat { + +namespace { + +constexpr StringView names[(size_t)script_lifecycle::COUNT] = +{ + "no-init"_s, "initializing"_s, "created"_s, "destroying"_s, "torn_down"_s, +}; + +} // namespace + +StringView base_script::state_name(script_lifecycle x) +{ + if (x >= script_lifecycle::COUNT) + fm_abort("invalid script_lifecycle value '%d'", (int)x); + else + return names[(uint32_t)x]; +} + +base_script::~base_script() noexcept = default; +base_script::base_script() noexcept = default; + +} // namespace floormat -- cgit v1.2.3