diff options
Diffstat (limited to 'src/script.cpp')
-rw-r--r-- | src/script.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
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 <cr/StringView.h> + +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 |