pandemonium_engine/modules/props_2d/prop_2d_instance_job.h

72 lines
1.5 KiB
C++
Raw Normal View History

2022-03-17 22:33:22 +01:00
#ifndef PROP_2D_INSTANCE_JOB
#define PROP_2D_INSTANCE_JOB
#include "scene/resources/texture.h"
#include "core/os/thread_pool_job.h"
#include "core/object/reference.h"
class Prop2DData;
class Prop2DInstance;
class Prop2DInstanceJob : public ThreadPoolJob {
GDCLASS(Prop2DInstanceJob, ThreadPoolJob);
public:
static const String BINDING_STRING_ACTIVE_BUILD_PHASE_TYPE;
enum ActiveBuildPhaseType {
BUILD_PHASE_TYPE_NORMAL = 0,
BUILD_PHASE_TYPE_PROCESS,
BUILD_PHASE_TYPE_PHYSICS_PROCESS,
};
public:
ActiveBuildPhaseType get_build_phase_type();
void set_build_phase_type(Prop2DInstanceJob::ActiveBuildPhaseType build_phase_type);
void set_prop(const Ref<Prop2DData> &prop);
void set_prop_instance(Prop2DInstance *instance);
void set_prop_instance_bind(Node *instance);
int get_phase();
void set_phase(const int phase);
void next_phase();
bool get_build_done();
void set_build_done(const bool val);
void finished();
void reset();
virtual void _reset();
void _execute();
void execute_phase();
virtual void _execute_phase();
void process(const float delta);
void physics_process(const float delta);
void prop_instance_enter_tree();
void prop_instance_exit_tree();
Prop2DInstanceJob();
~Prop2DInstanceJob();
protected:
static void _bind_methods();
ActiveBuildPhaseType _build_phase_type;
bool _build_done;
int _phase;
bool _in_tree;
Ref<Prop2DData> _prop;
Prop2DInstance *_instance;
};
VARIANT_ENUM_CAST(Prop2DInstanceJob::ActiveBuildPhaseType);
#endif