private void HandleUserDiet() { if (this.dietFactory == null) { this.dietFactory = new DietFactory(); } string currentRegimen = this.currentUser.Regimen.GetType().Name; this.currentUser.Regimen.Diet = this.dietFactory .CreateDiet(currentRegimen, this.currentUser.Weight, this.currentUser.Height, this.currentUser.Age, this.currentUser.Sex); this.Renderer.RenderMessage(Messages.SuccessfulDietSetMessage); this.dietFactory = null; }
/// <summary> /// Initializes a new instance of the <see cref="FitnessManagerConsole"/> class. /// </summary> /// <param name="userManager">An instance of UserManager class.</param> public FitnessManagerConsole(UserManager userManager, ConsoleRenderer renderer) : base(userManager, renderer) { this.currentUser = null; this.dietFactory = new DietFactory(); }