summaryrefslogtreecommitdiffhomepage
path: root/src/script.cpp
blob: 57df6e58f23b927012f8469b758a644104f1f5db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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