diff --git a/thread_pool_job.cpp b/thread_pool_job.cpp index 5fde81d..eb983ed 100644 --- a/thread_pool_job.cpp +++ b/thread_pool_job.cpp @@ -69,6 +69,11 @@ void ThreadPoolJob::set_stage(const int value) { _stage = value; } +void ThreadPoolJob::reset_stages() { + _current_run_stage = 0; + _stage = 0; +} + Variant ThreadPoolJob::get_object() const { return _object; } @@ -165,6 +170,8 @@ void ThreadPoolJob::_bind_methods() { ClassDB::bind_method(D_METHOD("set_stage", "value"), &ThreadPoolJob::set_stage); ADD_PROPERTY(PropertyInfo(Variant::INT, "stage"), "set_stage", "get_stage"); + ClassDB::bind_method(D_METHOD("reset_stages"), &ThreadPoolJob::reset_stages); + ClassDB::bind_method(D_METHOD("get_current_execution_time"), &ThreadPoolJob::get_current_execution_time); ClassDB::bind_method(D_METHOD("should_do", "just_check"), &ThreadPoolJob::should_do, DEFVAL(false)); diff --git a/thread_pool_job.h b/thread_pool_job.h index 3bb1b33..3b461d8 100644 --- a/thread_pool_job.h +++ b/thread_pool_job.h @@ -52,6 +52,8 @@ public: int get_stage() const; void set_stage(const int value); + void reset_stages(); + Variant get_object() const; void set_object(const Variant &value);