Add code examples, and documentation
This commit is contained in:
20
patterns/state/CarState/States/Off.cs
Normal file
20
patterns/state/CarState/States/Off.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
#region
|
||||
|
||||
using System;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace CarState.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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user