2022-07-08 01:30:19 +02:00
|
|
|
#ifndef USER_MANAGER_H
|
|
|
|
#define USER_MANAGER_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-08-17 12:53:49 +02:00
|
|
|
#include "core/containers/vector.h"
|
2022-07-08 01:30:19 +02:00
|
|
|
|
|
|
|
#include "scene/main/node.h"
|
|
|
|
|
|
|
|
class User;
|
|
|
|
|
|
|
|
class UserManager : public Node {
|
|
|
|
GDCLASS(UserManager, Node);
|
|
|
|
|
|
|
|
public:
|
|
|
|
Ref<User> get_user(const int id);
|
|
|
|
Ref<User> get_user_name(const String &user_name);
|
2023-09-22 16:33:21 +02:00
|
|
|
Ref<User> get_user_email(const String &user_email);
|
|
|
|
|
2022-07-08 01:30:19 +02:00
|
|
|
void save_user(const Ref<User> &user);
|
|
|
|
|
|
|
|
Ref<User> create_user();
|
|
|
|
|
|
|
|
bool is_username_taken(const String &user_name);
|
|
|
|
bool is_email_taken(const String &email);
|
|
|
|
|
|
|
|
virtual Ref<User> _get_user(const int id);
|
|
|
|
virtual Ref<User> _get_user_name(const String &user);
|
2023-09-22 16:33:21 +02:00
|
|
|
virtual Ref<User> _get_user_email(const String &user_email);
|
|
|
|
|
2022-07-08 01:30:19 +02:00
|
|
|
virtual void _save_user(Ref<User> user);
|
|
|
|
|
|
|
|
virtual Ref<User> _create_user();
|
|
|
|
|
|
|
|
virtual bool _is_username_taken(const String &user_name);
|
|
|
|
virtual bool _is_email_taken(const String &email);
|
|
|
|
|
2022-07-21 17:31:14 +02:00
|
|
|
virtual Vector<Ref<User>> get_all();
|
2022-07-08 01:30:19 +02:00
|
|
|
|
|
|
|
UserManager();
|
|
|
|
~UserManager();
|
|
|
|
|
|
|
|
protected:
|
2022-07-21 19:48:37 +02:00
|
|
|
void _notification(int p_what);
|
|
|
|
|
2022-07-08 01:30:19 +02:00
|
|
|
static void _bind_methods();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|