I made a list of cars, the factory produces every 4 cars broken (public bool Broken;
).
My code
public static void BuildCar()
{
List<Factory> cars = new List<Factory>();
for (int i = 1; i < 10; i++)
{
Factory newCars = new Cars("string", "string", "bool");
if (i % 4 == 0)
{
newCars.Broken = true;
cars.Add(newCars);
}
else
{
newCars.Broken = false;
cars.Add(newCars);
}
}
}
What I did
A list of all the cars (good and broken).
What I need to do
Create a method that copies only good cars to another list.
Thx.