entity_spell_system/entities/stats/stat_data_entry.h

80 lines
1.5 KiB
C
Raw Normal View History

2019-09-16 03:13:52 +02:00
#ifndef STAT_DATA_ENTRY_H
#define STAT_DATA_ENTRY_H
#include "core/resource.h"
2019-10-15 18:34:19 +02:00
#include "scene/resources/curve.h"
2019-09-16 03:13:52 +02:00
#include "level_stat_data.h"
2019-10-15 18:34:19 +02:00
#include "stat.h"
2019-09-16 03:13:52 +02:00
class StatDataEntry : public Resource {
2019-10-15 18:34:19 +02:00
GDCLASS(StatDataEntry, Resource);
2019-09-16 03:13:52 +02:00
public:
2019-10-15 18:34:19 +02:00
Stat::StatId get_stat_id();
void set_stat_id(Stat::StatId value);
2019-09-16 03:13:52 +02:00
2019-10-15 18:34:19 +02:00
bool get_public();
void set_public(bool value);
2019-09-16 03:13:52 +02:00
2019-10-15 18:34:19 +02:00
float get_base();
void set_base(float value);
2019-09-16 03:13:52 +02:00
2019-10-15 18:34:19 +02:00
float get_bonus();
void set_bonus(float value);
2019-10-15 14:57:59 +02:00
2019-10-15 18:34:19 +02:00
float get_percent();
void set_percent(float value);
2019-10-15 14:57:59 +02:00
2019-10-15 18:34:19 +02:00
Stat::StatModifierApplyType get_modifier_apply_type();
void set_modifier_apply_type(Stat::StatModifierApplyType value);
2019-09-16 03:13:52 +02:00
2019-10-15 18:34:19 +02:00
bool has_mod_stats();
2019-10-15 18:34:19 +02:00
int get_mod_stat_count();
void set_mod_stat_count(int value);
2019-09-16 03:13:52 +02:00
2019-10-15 18:34:19 +02:00
Stat::StatId get_mod_stat_id(int index);
void set_mod_stat_id(int index, Stat::StatId value);
2019-09-16 03:13:52 +02:00
2019-10-15 18:34:19 +02:00
Ref<Curve> get_mod_stat_curve(int index);
void set_mod_stat_curve(int index, Ref<Curve> curve);
2019-09-16 03:13:52 +02:00
float get_mod_stat_max_value(int index);
void set_mod_stat_max_value(int index, float value);
2019-10-15 18:34:19 +02:00
void get_stats_for_stat(Ref<Stat> stat);
2019-09-16 03:13:52 +02:00
2019-10-15 18:34:19 +02:00
StatDataEntry();
~StatDataEntry();
2019-09-16 03:13:52 +02:00
protected:
2019-10-15 18:34:19 +02:00
static void _bind_methods();
void _validate_property(PropertyInfo &property) const;
2019-09-16 03:13:52 +02:00
2019-10-15 18:34:19 +02:00
public:
struct ModStat {
Stat::StatId stat_id;
Ref<Curve> curve;
float max_value;
2019-10-15 18:34:19 +02:00
};
2019-09-16 03:13:52 +02:00
2019-10-15 18:34:19 +02:00
enum {
MAX_MOD_STATS = 3,
};
2019-09-16 03:13:52 +02:00
private:
Stat::StatId _stat_id;
2019-10-15 18:34:19 +02:00
bool _public;
2019-09-16 03:13:52 +02:00
float _base;
float _bonus;
float _percent;
2019-10-15 18:34:19 +02:00
int _mod_stat_count;
ModStat _mod_stats[MAX_MOD_STATS];
2019-09-16 03:13:52 +02:00
2019-10-15 18:34:19 +02:00
Stat::StatModifierApplyType _modifier_apply_type;
2019-09-16 03:13:52 +02:00
};
#endif