Added reset_stages() to ThreadPoolJob.

This commit is contained in:
Relintai 2020-08-04 14:50:41 +02:00
parent bbfa838011
commit ff3224f7d0
2 changed files with 9 additions and 0 deletions

View File

@ -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));

View File

@ -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);