, . , , , Engine , .
, , , ; , Engine namespace CarsAreCool.Car, Car.Engine, Engine Car.
, , :
, IVehicle, , , .
public interface IVehicle
{
public Engine Engine;
public int PassengerCapacity;
public int NumberOfWheels;
}
Car, Truck, Van, Motorcycle .. , . Motorcycle. - , , , HelmetColor, HelmetSize, HelmetVisorType off Motorcycle ? , Helmet. , , , , .
public class Motorcycle : IVehicle
{
#region IVehicle implementation
#endregion
#region Nested Types
public sealed class Helmet
{
public string Color;
public string Size;
public string VisorType;
public bool RequiredByLaw;
}
public Helmet Helmet;
public decimal Mileage;
#endregion
}