Exemplo n.º 1
0
        public override string ToString()
        {
            StringBuilder vehicleDescription = new StringBuilder();

            vehicleDescription.AppendLine("Vehicle Description:");
            vehicleDescription.AppendFormat("Vehicle Type          {0} {1}", GetType().Name, Environment.NewLine);
            vehicleDescription.AppendFormat("Engine Type           {0} {1}", m_Engine.GetType().Name, Environment.NewLine);
            vehicleDescription.AppendFormat("Model:                {0} {1}", m_ModelName, Environment.NewLine);
            vehicleDescription.AppendFormat("License plate number: {0} {1}", m_LicensePlateNumber, Environment.NewLine);
            vehicleDescription.AppendFormat("Wheels count:         {0} {1}", m_WheelsCount, Environment.NewLine);
            vehicleDescription.AppendFormat("Energy left :{0:00.00}% {1}", this.Energy, Environment.NewLine);
            vehicleDescription.AppendFormat(m_Wheels[0].ToString());
            vehicleDescription.AppendFormat(m_Engine.ToString());

            return(vehicleDescription.ToString());
        }
Exemplo n.º 2
0
 public Type GetEngineType()
 {
     return(m_Engine.GetType());
 }