15 lines
288 B
C#
15 lines
288 B
C#
namespace WithStatePattern.States;
|
|
|
|
public class Off : State
|
|
{
|
|
public Off(Car car)
|
|
: base(car) { }
|
|
|
|
public override void TurnKeyClockwise()
|
|
{
|
|
Console.WriteLine("The engine has started");
|
|
Console.WriteLine();
|
|
_car.ChangeState(new Stopped(_car));
|
|
}
|
|
}
|