You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
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<string> Steps { get; private set; }
|
|
|
|
|
private int _currentStepIndex;
|
|
|
|
|
public int CurrentStepIndex { get { return _currentStepIndex; } }
|
|
|
|
|
|
|
|
|
|
public Recipe(string name, List<string> 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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|