Ejemplo n.º 1
0
        /// <summary>
        /// Remove Part from the current configuration
        /// </summary>
        /// <param name="part"></param>
        public void RemovePart(Part part)
        {
            if (part is PerformancePart)
            {
                PerformancePart _part = part as PerformancePart;
                Horsepower -= _part.MaxPower;

                Torque -= _part.MaxTorque;

                maxrpm -= _part.MaxEngineSpeed;

                zeroToSixty += _part.ZeroToSixty;

                topTrackSpeed -= _part.TopTrackSpeed;

                displacment -= _part.Displacment;
            }

            PriceParts -= part.Price;
            parts.Remove(part);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Add Parts to the current configuration
        /// </summary>
        /// <param name="part"></param>
        public void AddPart(Part part)
        {
            if (part is PerformancePart)
            {
                PerformancePart _part = part as PerformancePart;
                Horsepower += _part.MaxPower;

                Torque += _part.MaxTorque;

                maxrpm += _part.MaxEngineSpeed;

                zeroToSixty -= _part.ZeroToSixty;

                topTrackSpeed += _part.TopTrackSpeed;

                displacment += _part.Displacment;
            }

            PriceParts += part.Price;
            parts.Add(part);
        }