using System;namespace Cars{ public enum Direction { Left, Right } public class TurnEventArgs : EventArgs { public TurnEventArgs(Direction direction) { Direction = direction; } public Direction Direction { get; } } public abstract class Car { public event EventHandler Started; public event EventHandler Stopped; public event EventHandler<TurnEventArgs> Turned; public int Speed { get; set; } public string Color { get; set; } public string Name { get; set; } public virtual bool IsPolice => false; public void Go() { Started?.Invoke(this, EventArgs.Empty); } public void Stop() { Stopped?.Invoke(this, EventArgs.Empty); } public void Turn(Direction direction) { Turned?.Invoke(this, new TurnEventArgs(direction)); } } public class TownCar : Car { } public class SportCar : Car { } public class WorkCar : Car { } public class PoliceCar : Car { public override bool IsPolice => true; }}