using Models.Endpoint; using Models; namespace ShoopNCook.Controllers { public class ConnectionController : LoginController, RegisterController { private readonly ConnectionObserver observer; private readonly IAccountManager accounts; public ConnectionController(ConnectionObserver observer, IAccountManager accounts) { this.observer = observer; this.accounts = accounts; } public void Login(string email, string password) { Account acc = accounts.Login(email, password); observer.OnAccountConnected(acc); } public void Register(string username, string email, string password) { Account acc = accounts.Register(username, email, password); observer.OnAccountConnected(acc); } } }