2019-08-05 23:59:37 +02:00
|
|
|
#ifndef STAT_MODIFIER_H
|
|
|
|
#define STAT_MODIFIER_H
|
|
|
|
|
|
|
|
#include "core/reference.h"
|
|
|
|
|
2019-10-15 14:57:59 +02:00
|
|
|
class Stat;
|
|
|
|
|
2019-08-05 23:59:37 +02:00
|
|
|
class StatModifier : public Reference {
|
|
|
|
GDCLASS(StatModifier, Reference);
|
|
|
|
|
|
|
|
public:
|
2019-10-15 14:57:59 +02:00
|
|
|
StatModifier();
|
|
|
|
|
|
|
|
StatModifier(int i, float base_mod, float bonus_mod, float percent_mod, Stat *owner);
|
|
|
|
|
|
|
|
Ref<Stat> get_owner();
|
|
|
|
void set_owner(Ref<Stat> stat);
|
|
|
|
|
|
|
|
int get_id();
|
|
|
|
void set_id(int value);
|
2019-08-05 23:59:37 +02:00
|
|
|
|
2019-10-15 14:57:59 +02:00
|
|
|
float get_base_mod();
|
|
|
|
void set_base_mod(float value);
|
2019-08-05 23:59:37 +02:00
|
|
|
|
2019-10-15 14:57:59 +02:00
|
|
|
float get_bonus_mod();
|
|
|
|
void set_bonus_mod(float value);
|
2019-08-05 23:59:37 +02:00
|
|
|
|
2019-10-15 14:57:59 +02:00
|
|
|
float get_percent_mod();
|
|
|
|
void set_percent_mod(float value);
|
2019-08-05 23:59:37 +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-08-05 23:59:37 +02:00
|
|
|
protected:
|
2019-09-13 09:26:53 +02:00
|
|
|
static void _bind_methods();
|
2019-08-05 23:59:37 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
int _id;
|
|
|
|
float _base_mod;
|
|
|
|
float _bonus_mod;
|
|
|
|
float _percent_mod;
|
2019-10-15 14:57:59 +02:00
|
|
|
|
|
|
|
Stat *_owner;
|
2019-08-05 23:59:37 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|