public static void CreateSampleCars() { CarLib.CreateCar("Honda", 400, true, Color.Aquamarine, ACCESSORIES.Camera); CarLib.CreateCar("Nissan", 400, true, Color.Aquamarine, ACCESSORIES.Camera); CarLib.CreateCar("Mazda", 400, true, Color.Aquamarine, ACCESSORIES.GPS | ACCESSORIES.DVDPlayer); CarLib.CreateCar("Ford", 400, true, Color.Aquamarine, ACCESSORIES.Camera | ACCESSORIES.SecurityClock); CarLib.CreateCar("Nissan", 400, true, Color.Aquamarine, ACCESSORIES.None); CarLib.CreateCar("Honda", 400, true, Color.Aquamarine, ACCESSORIES.Warmer); }
public static void CreateCar(string carName, double carSpeed, bool used, Color color, ACCESSORIES accessory) { CarLib car = new CarLib { CarID = NUMBEROFCAR, CarName = carName, CarSpeed = carSpeed, Used = used, Color = color }; car.Accessory.Add(accessory); cars.Add(car); NUMBEROFCAR++; }