static void Main(string[] args) { var car1 = new Car { GrossWeight = 1500, Mileage = 14222 }; var oilSystem = new OilSystem { OilTypes = new List <OilType> { OilType.Oil_0W30_Diesel }, OilChangeInterval = 10000, Quantity = 5, }; car1.OilSystem = oilSystem; car1.OilSystem.OilChanged += Announce_OilChange; car1.OilSystem.ChangeOil(car1.Mileage); Console.ReadKey(); }
public Car() { OilSystem = new OilSystem(); }