2022-07-21 17:31:14 +02:00
|
|
|
#ifndef USER_MANAGER_STATIC_H
|
|
|
|
#define USER_MANAGER_STATIC_H
|
|
|
|
|
2023-12-18 00:18:53 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* user_manager_static.h */
|
|
|
|
/*************************************************************************/
|
|
|
|
/* This file is part of: */
|
|
|
|
/* PANDEMONIUM ENGINE */
|
|
|
|
/* https://github.com/Relintai/pandemonium_engine */
|
|
|
|
/*************************************************************************/
|
|
|
|
/* Copyright (c) 2022-present Péter Magyar. */
|
|
|
|
/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */
|
|
|
|
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */
|
|
|
|
/* */
|
|
|
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
|
|
|
/* a copy of this software and associated documentation files (the */
|
|
|
|
/* "Software"), to deal in the Software without restriction, including */
|
|
|
|
/* without limitation the rights to use, copy, modify, merge, publish, */
|
|
|
|
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
|
|
|
/* permit persons to whom the Software is furnished to do so, subject to */
|
|
|
|
/* the following conditions: */
|
|
|
|
/* */
|
|
|
|
/* The above copyright notice and this permission notice shall be */
|
|
|
|
/* included in all copies or substantial portions of the Software. */
|
|
|
|
/* */
|
|
|
|
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
|
|
|
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
|
|
|
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
|
|
|
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
|
|
|
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
|
|
|
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
|
|
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
#include "core/containers/vector.h"
|
2022-08-17 13:45:14 +02:00
|
|
|
#include "core/object/reference.h"
|
2023-12-18 00:18:53 +01:00
|
|
|
#include "core/os/rw_lock.h"
|
2022-08-17 14:19:55 +02:00
|
|
|
#include "core/string/ustring.h"
|
2022-07-21 17:31:14 +02:00
|
|
|
|
|
|
|
#include "user_manager.h"
|
|
|
|
|
|
|
|
class User;
|
|
|
|
|
|
|
|
class UserManagerStatic : public UserManager {
|
|
|
|
GDCLASS(UserManagerStatic, UserManager);
|
|
|
|
|
|
|
|
public:
|
|
|
|
Ref<User> _get_user(const int id);
|
|
|
|
Ref<User> _get_user_name(const String &user);
|
2023-09-22 16:33:21 +02:00
|
|
|
Ref<User> _get_user_email(const String &user_email);
|
2023-12-18 00:18:53 +01:00
|
|
|
|
2022-07-21 17:31:14 +02:00
|
|
|
void _save_user(Ref<User> user);
|
|
|
|
|
|
|
|
Ref<User> _create_user();
|
|
|
|
|
|
|
|
bool _is_username_taken(const String &user_name);
|
|
|
|
bool _is_email_taken(const String &email);
|
|
|
|
|
|
|
|
Vector<Ref<User>> get_all();
|
|
|
|
|
|
|
|
Vector<Variant> get_users();
|
|
|
|
void set_users(const Vector<Variant> &users);
|
|
|
|
|
2022-07-21 18:08:52 +02:00
|
|
|
String get_create_user_name_bind();
|
|
|
|
void set_create_user_name_bind(const String &val);
|
|
|
|
|
|
|
|
String get_create_user_email_bind();
|
|
|
|
void set_create_user_email_bind(const String &val);
|
|
|
|
|
|
|
|
String get_create_user_password_bind();
|
|
|
|
void set_create_user_password_bind(const String &val);
|
|
|
|
|
|
|
|
bool get_create_user_bind();
|
|
|
|
void set_create_user_bind(const bool val);
|
|
|
|
|
2022-07-21 17:31:14 +02:00
|
|
|
UserManagerStatic();
|
|
|
|
~UserManagerStatic();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
|
|
|
|
|
|
|
Vector<Ref<User>> _users;
|
2022-07-21 18:08:52 +02:00
|
|
|
|
|
|
|
String _create_user_name;
|
|
|
|
String _create_user_email;
|
|
|
|
String _create_user_password;
|
2022-07-21 17:31:14 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|