AcManager.Controls.CustomShowroom.PaintShop.GetPaintableItems C# (CSharp) Метод

GetPaintableItems() публичный статический Метод

public static GetPaintableItems ( string carId, [ kn5 ) : IEnumerable
carId string
kn5 [
Результат IEnumerable
        public static IEnumerable<PaintableItem> GetPaintableItems(string carId, [CanBeNull] Kn5 kn5) {
            switch (carId) {
                case "peugeot_504":
                    return new PaintableItem[] {
                        new LicensePlate(LicensePlate.LicenseFormat.Europe),
                        new ComplexCarPaint("car_paint.dds", "carpaint_MAP.dds", Colors.BurlyWood),
                        new ColoredItem("rims_color.dds", Colors.CadetBlue) {
                            DisplayName = "Rims",
                            Enabled = false
                        },
                        new ColoredItem("int_inside_color.dds", Colors.Wheat) {
                            DisplayName = "Interior",
                            Enabled = false
                        },
                        new ColoredItem("int_leather_color.dds", Colors.Brown) {
                            DisplayName = "Leather",
                            Enabled = false
                        },
                        new ColoredItem("int_cloth_color.dds", Colors.Wheat) {
                            DisplayName = "Cloth",
                            Enabled = false
                        },
                        new TransparentIfFlagged("ext_headlight_yellow.dds", true, true) {
                            DisplayName = "Yellow headlights"
                        },
                        new TintedWindows("ext_glass.dds") {
                            Enabled = false
                        },
                    };

                case "peugeot_504_tn":
                    return new PaintableItem[] {
                        new LicensePlate(LicensePlate.LicenseFormat.Europe),
                        new ComplexCarPaint("tn_car_paint.dds", "tn_carpaint_MAP.dds") {
                            TakeOriginalMapsFromDiffuse = "tn_carpaint_SKIN.dds"
                        },
                        new ColoredItem("tn_rims_color.dds", Colors.Black) {
                            DisplayName = "Rims",
                            Enabled = false
                        },
                        new ColoredItem("tn_int_inside_color.dds", Colors.Wheat) {
                            DisplayName = "Interior",
                            Enabled = false
                        },
                        new ColoredItem("tn_int_leather_color.dds", Colors.Black) {
                            DisplayName = "Leather",
                            Enabled = false
                        },
                        new ColoredItem("tn_int_cloth_color.dds", Colors.Wheat) {
                            DisplayName = "Cloth",
                            Enabled = false
                        },
                        new TintedWindows("ext_glass.dds") {
                            Enabled = false
                        },
                    };

                case "acc_porsche_914-6":
                    return new PaintableItem[] {
                        new LicensePlate(LicensePlate.LicenseFormat.Europe),
                        new ComplexCarPaint("car_paint.dds", "ext_MAP.dds"),
                        new ColoredItem("car_paint_rims.dds", Colors.Black) {
                            DisplayName = "Rims",
                            Enabled = false
                        },
                        new TintedWindows("ext_glass.dds") {
                            Enabled = false
                        },
                    };
            }

            return kn5 == null ? new PaintableItem[0] : new PaintableItem[] {
                kn5.Textures.ContainsKey("Plate_D.dds") && kn5.Textures.ContainsKey("Plate_NM.dds") ?
                        new LicensePlate(LicensePlate.LicenseFormat.Europe) : null,
                new[] { "metal_detail.dds", "car_paint.dds", "carpaint.dds" }.Where(x => kn5.Textures.ContainsKey(x))
                                                                             .Select(x => new CarPaint(x))
                                                                             .FirstOrDefault(),
                new[] { "car_paint_rims.dds" }.Where(x => kn5.Textures.ContainsKey(x))
                                              .Select(x => new ColoredItem(x, Colors.AliceBlue) {
                                                  DisplayName = "Rims",
                                                  Enabled = false
                                              })
                                              .FirstOrDefault(),
                new[] { "car_paint_roll_cage.dds" }.Where(x => kn5.Textures.ContainsKey(x))
                                              .Select(x => new ColoredItem(x, Colors.AliceBlue) {
                                                  DisplayName = "Roll cage",
                                                  Enabled = false
                                              })
                                              .FirstOrDefault(),
                new[] { "car_paint_roll_cage.dds" }.Where(x => kn5.Textures.ContainsKey(x))
                                              .Select(x => new ColoredItem(x, Colors.AliceBlue) {
                                                  DisplayName = "Roll cage",
                                                  Enabled = false
                                              })
                                              .FirstOrDefault(),
                new[] { "ext_glass.dds" }.Where(x => kn5.Textures.ContainsKey(x))
                                              .Select(x => new TintedWindows(x) {
                                                  Enabled = false
                                              })
                                              .FirstOrDefault(),
            }.Where(x => x != null);
        }
    }