Пример #1
0
        /// <summary>
        /// Gets the <see cref="VehicleColor"/> of this <see cref="Vehicle"/>
        /// </summary>
        public static VehicleColor GetColor(this Vehicle vehicle)
        {
            NativeWrappers.GetVehicleColours(vehicle, out int primary, out int secondary);
            VehiclePaint primaryColor   = primary >= 0 && primary <= 160 ? (VehiclePaint)primary : VehiclePaint.Unknown;
            VehiclePaint secondaryColor = secondary >= 0 && secondary <= 160 ? (VehiclePaint)secondary : VehiclePaint.Unknown;

            return(new VehicleColor(primaryColor, secondaryColor));
        }