pandemonium_engine/modules/entity_spell_system/entities/resources/entity_resource.h

119 lines
2.8 KiB
C++
Raw Normal View History

2022-03-17 22:33:22 +01:00
#ifndef ENTITY_RESOURCE_H
#define ENTITY_RESOURCE_H
2023-12-17 22:59:50 +01:00
#include "core/object/resource.h"
#include "../../defines.h"
class Entity;
class EntityResource : public Resource {
GDCLASS(EntityResource, Resource);
public:
int get_id() const;
void set_id(const int value);
String get_text_name() const;
void set_text_name(const String value);
bool get_dirty() const;
void set_dirty(const bool value);
bool get_should_process() const;
void set_should_process(const bool value);
int get_current_value() const;
void set_current_value(const int value);
int get_max_value() const;
void set_max_value(const 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 notification_sstat_changed(const int statid, const float current);
void notification_cstat_changed(const int statid, const float current);
void ons_target_changed(Entity *entity, Entity *old_target);
void onc_target_changed(Entity *entity, Entity *old_target);
void process_server(const float delta);
void _process_server(const float delta);
void process_client(const float delta);
void _process_client(const float delta);
void receivec_update(const int current);
void receivec_update_full(const int current, const int max);
void receivec_update_string(const String str);
PoolRealArray get_stacking_mods();
void set_stacking_mods(const PoolRealArray &mods);
void add_stacking_mod(const float value);
void remove_stacking_mod(const float value);
PoolRealArray get_non_stacking_mods();
void set_non_stacking_mods(const PoolRealArray &mods);
void add_non_stacking_mod(const float value);
void remove_non_stacking_mod(const float value);
float get_current_stacking_mod_value() const;
float get_current_positive_non_stacking_mod_value() const;
float get_current_negative_non_stacking_mod_value() const;
void refresh_current_stacking_mod_value();
void refresh_current_non_stacking_mod_values();
void mods_changed();
Dictionary to_dict();
void from_dict(const Dictionary &dict);
Dictionary _to_dict();
void _from_dict(const Dictionary &dict);
EntityResource();
~EntityResource();
protected:
void _stacking_mod_added(const float value);
void _stacking_mod_removed(const float value);
void _non_stacking_mod_added(const float value);
void _non_stacking_mod_removed(const float value);
void _mods_changed();
static void _bind_methods();
private:
int _id;
String _text_name;
bool _server_side;
Entity *_owner;
bool _dirty;
bool _should_process;
int _current;
int _max;
float _current_stacking_mod_value;
float _current_positive_non_stacking_mod_value;
float _current_negative_non_stacking_mod_value;
PoolRealArray _stacking_mods;
PoolRealArray _non_stacking_mods;
};
#endif