#ifndef USER_MANAGER_FILE_H #define USER_MANAGER_FILE_H #include "core/os/rw_lock.h" #include "core/object/reference.h" #include "core/string/ustring.h" #include "core/containers/vector.h" #include "user_manager.h" class User; class UserManagerFile : public UserManager { GDCLASS(UserManagerFile, UserManager); public: String get_save_folder_path(); void set_save_folder_path(const String &val); Ref _get_user(const int id); Ref _get_user_name(const String &user); Ref _get_user_email(const String &user_email); void _save_user(Ref user); Ref _create_user(); bool _is_username_taken(const String &user_name); bool _is_email_taken(const String &email); Vector> get_all(); UserManagerFile(); ~UserManagerFile(); protected: void load(); void save(); void _on_user_changed(); void _notification(int p_what); static void _bind_methods(); Vector> _users; RWLock _rw_lock; bool _save_queued; String _save_folder_path; }; #endif