2019-06-22 23:28:36 +02:00
|
|
|
#ifndef ENTITY_RESOURCE_H
|
|
|
|
#define ENTITY_RESOURCE_H
|
|
|
|
|
|
|
|
#include "core/reference.h"
|
|
|
|
|
2019-08-13 23:58:42 +02:00
|
|
|
class Stat;
|
|
|
|
class Entity;
|
|
|
|
|
2019-06-22 23:28:36 +02:00
|
|
|
class EntityResource : public Reference {
|
|
|
|
GDCLASS(EntityResource, Reference);
|
|
|
|
|
|
|
|
public:
|
|
|
|
bool get_dirty();
|
|
|
|
void set_dirty(bool value);
|
|
|
|
|
|
|
|
bool get_should_process();
|
|
|
|
void set_should_process(bool value);
|
|
|
|
|
2019-08-13 23:58:42 +02:00
|
|
|
int get_resource_type();
|
|
|
|
void set_resource_type(int value);
|
|
|
|
|
|
|
|
int get_current();
|
|
|
|
void set_current(int value);
|
|
|
|
|
|
|
|
int get_max();
|
|
|
|
void set_max(int value);
|
|
|
|
|
|
|
|
Entity *get_owner();
|
|
|
|
void set_owner(Entity *entity);
|
|
|
|
void set_owner_bind(Node *owner);
|
|
|
|
|
|
|
|
void ons_added(Entity *owner);
|
|
|
|
void onc_added(Entity *owner);
|
|
|
|
|
|
|
|
void ons_stat_changed(Ref<Stat> stat);
|
|
|
|
void onc_stat_changed(Ref<Stat> stat);
|
|
|
|
|
2019-09-27 18:05:43 +02:00
|
|
|
void ons_target_changed(Entity *entity, Entity *old_target);
|
|
|
|
void onc_target_changed(Entity *entity, Entity *old_target);
|
2019-08-13 23:58:42 +02:00
|
|
|
|
2019-06-22 23:28:36 +02:00
|
|
|
void process(float delta);
|
2019-08-13 23:58:42 +02:00
|
|
|
void _process(float delta);
|
|
|
|
|
|
|
|
String gets_update_string();
|
|
|
|
void receivec_update_string(String str);
|
2019-06-22 23:28:36 +02:00
|
|
|
|
2019-09-13 09:26:53 +02:00
|
|
|
Dictionary to_dict();
|
|
|
|
void from_dict(const Dictionary &dict);
|
|
|
|
|
|
|
|
Dictionary _to_dict();
|
|
|
|
void _from_dict(const Dictionary &dict);
|
|
|
|
|
2019-06-22 23:28:36 +02:00
|
|
|
EntityResource();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
|
|
|
|
|
|
|
private:
|
2019-08-13 23:58:42 +02:00
|
|
|
Entity *_owner;
|
2019-06-22 23:28:36 +02:00
|
|
|
bool _dirty;
|
|
|
|
bool _should_process;
|
2019-08-13 23:58:42 +02:00
|
|
|
int _type;
|
|
|
|
int _current;
|
|
|
|
int _max;
|
2019-06-22 23:28:36 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|