using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace FSM.Recipes { class Recipe { public string Name { get; private set; } public List Steps { get; private set; } private int _currentStepIndex; public int CurrentStepIndex { get { return _currentStepIndex; } } public Recipe(string name, List steps) { Name = name; Steps = steps; _currentStepIndex = 0; } public void Reset() { _currentStepIndex = 0; } public string GetCurrentStep() { if (_currentStepIndex < Steps.Count) return Steps[_currentStepIndex]; return null; } public bool MoveToNextStep() { if (_currentStepIndex < Steps.Count - 1) { _currentStepIndex++; return true; } return false; } } }