public class ChocolateBoiler
{
public bool Empty { get; private set; }
public bool Boiled { get; private set; }
public static ChocolateBoiler Instance { get; } = new ChocolateBoiler();
private ChocolateBoiler()
{
Empty = true;
Boiled = false;
}
public void Fill()
{
if (Empty)
{
Empty = false;
Boiled = false;
Console.WriteLine("Filling the boiler with milk/chocolate mixture");
}
}
public void Boil()
{
if (!Empty && !Boiled)
{
Boiled = true;
Console.WriteLine("Boiling the mixture");
}
}
public void Drain()
{
if (!Empty && Boiled)
{
Empty = true;
Console.WriteLine("Draining the boiled chocolate");
}
}
}
public class ChocolateBoiler
{
public bool Empty { get; private set; }
public bool Boiled { get; private set; }
public static ChocolateBoiler Instance { get; } = new ChocolateBoiler();
private ChocolateBoiler()
{
Empty = true;
Boiled = false;
}
public void Fill()
{
if (Empty)
{
Empty = false;
Boiled = false;
Console.WriteLine("Filling the boiler with milk/chocolate mixture");
}
}
public void Boil()
{
if (!Empty && !Boiled)
{
Boiled = true;
Console.WriteLine("Boiling the mixture");
}
}
public void Drain()
{
if (!Empty && Boiled)
{
Empty = true;
Console.WriteLine("Draining the boiled chocolate");
}
}
}