basic manager layout & re-design model

This commit is contained in:
2024-05-17 20:12:08 +02:00
parent 5055540f76
commit dab404d95e
10 changed files with 257 additions and 23 deletions

View File

@@ -1,13 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OwnChar.Data;
using OwnChar.Model;
using Pilz.Cryptography;
namespace OwnChar.Manager
{
public class OwnCharManager
{
// User
public bool IsLoggedIn { get; set; }
public UserAccount? CurrentUser { get; set; }
// Data Provider
public IDataProvider DataProvider { get; set; }
// Manager
public UserManager Users { get; }
public GroupsManager Groups { get; }
public CharacterManager Characters { get; }
public OwnCharManager(IDataProvider dataProvider)
{
DataProvider = dataProvider;
Users = new(this);
Groups = new(this);
Characters = new(this);
}
/// <summary>
/// Tries to login on the server.
/// </summary>
/// <returns>Returns <see cref="true"/> if the login was successfull and <see cref="false"/> if not.</returns>
public bool Login(string username, SecureString password)
{
return IsLoggedIn = true; // TODO: Change `true` to the real check.
}
}
}