summaryrefslogtreecommitdiffhomepage
path: root/src/object.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/object.cpp')
-rw-r--r--src/object.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/object.cpp b/src/object.cpp
index f4c803b7..1bc6e015 100644
--- a/src/object.cpp
+++ b/src/object.cpp
@@ -365,4 +365,39 @@ void object::init_script(const std::shared_ptr<object>&) {}
void object::destroy_script_pre(const std::shared_ptr<object>&, script_destroy_reason) {}
void object::destroy_script_post() {}
+void object::check_script_update_1(script_lifecycle state)
+{
+ switch (state)
+ {
+ case script_lifecycle::no_init:
+ //return; // for tests?
+ case script_lifecycle::COUNT:
+ case script_lifecycle::destroying:
+ case script_lifecycle::initializing:
+ case script_lifecycle::torn_down:
+ break;
+ case script_lifecycle::created:
+ return;
+ }
+ fm_abort("bad script state %d in update() #1", (int)state);
+}
+
+bool object::check_script_update_2(script_lifecycle state)
+{
+ switch (state)
+ {
+ case script_lifecycle::no_init:
+ // bad = false; break; // for tests?
+ case script_lifecycle::COUNT:
+ case script_lifecycle::destroying:
+ case script_lifecycle::initializing:
+ break;
+ case script_lifecycle::torn_down:
+ return true;
+ case script_lifecycle::created:
+ return false;
+ }
+ fm_abort("bad script state %d in update() #2", (int)state);
+}
+
} // namespace floormat