2022-03-17 22:33:22 +01:00
|
|
|
#ifndef PLAYER_PROFILE_H
|
|
|
|
#define PLAYER_PROFILE_H
|
2022-03-15 13:29:32 +01:00
|
|
|
|
|
|
|
|
2022-08-17 13:17:12 +02:00
|
|
|
#include "core/variant/dictionary.h"
|
2022-08-17 13:45:14 +02:00
|
|
|
#include "core/object/reference.h"
|
2022-08-17 14:19:55 +02:00
|
|
|
#include "core/string/ustring.h"
|
2022-03-15 13:29:32 +01:00
|
|
|
|
|
|
|
#include "class_profile.h"
|
|
|
|
|
|
|
|
class PlayerProfile : public Reference {
|
|
|
|
GDCLASS(PlayerProfile, Reference);
|
|
|
|
|
|
|
|
public:
|
|
|
|
static const String DEFAULT_PROFILE_FILE_NAME;
|
|
|
|
|
|
|
|
int get_id();
|
|
|
|
void set_id(int value);
|
|
|
|
|
|
|
|
String get_profile_name();
|
|
|
|
void set_profile_name(String value);
|
|
|
|
|
|
|
|
int get_last_used_character() const;
|
|
|
|
void set_last_used_character(const int value);
|
|
|
|
|
|
|
|
int get_class_profile_count() const;
|
|
|
|
Ref<ClassProfile> get_class_profile_index(const int index);
|
|
|
|
void add_class_profile(Ref<ClassProfile> profile);
|
|
|
|
void clear_class_profiles();
|
|
|
|
void remove_class_profile(const int index);
|
|
|
|
|
2022-03-18 03:56:41 +01:00
|
|
|
Vector<Ref<ClassProfile>> &get_class_profiles();
|
2022-03-15 13:29:32 +01:00
|
|
|
Ref<ClassProfile> get_class_profile(const StringName &class_path);
|
|
|
|
|
|
|
|
Dictionary get_custom_data();
|
|
|
|
void set_custom_data(const Dictionary &dict);
|
|
|
|
|
|
|
|
Dictionary to_dict() const;
|
|
|
|
void from_dict(const Dictionary &dict);
|
|
|
|
|
|
|
|
void emit_change();
|
|
|
|
|
|
|
|
PlayerProfile();
|
|
|
|
~PlayerProfile();
|
|
|
|
|
|
|
|
void load_defaults();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void _on_class_profile_changed();
|
|
|
|
|
|
|
|
static void _bind_methods();
|
|
|
|
|
|
|
|
private:
|
|
|
|
int _id;
|
|
|
|
int _last_used_character;
|
|
|
|
String _profile_name;
|
|
|
|
|
|
|
|
Dictionary _custom_data;
|
|
|
|
|
2022-03-18 03:56:41 +01:00
|
|
|
Vector<Ref<ClassProfile>> _class_profiles;
|
2022-03-15 13:29:32 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|