Skip to content

Commit

Permalink
Added reset_stages() to ThreadPoolJob.
Browse files Browse the repository at this point in the history
  • Loading branch information
Relintai committed Aug 4, 2020
1 parent bbfa838 commit ff3224f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions thread_pool_job.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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));
Expand Down
2 changes: 2 additions & 0 deletions thread_pool_job.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ class ThreadPoolJob : public Reference {
int get_stage() const;
void set_stage(const int value);

void reset_stages();

Variant get_object() const;
void set_object(const Variant &value);

Expand Down

0 comments on commit ff3224f

Please sign in to comment.