public List <CarPartComponent> GetAllComponents(CarPartComponent.ComponentType inComponentType, CarPart.PartType inPartType) { List <CarPartComponent> inList = new List <CarPartComponent>(); inList.AddRange((IEnumerable <CarPartComponent>) this.components.Values); return(CarPartComponentsManager.GetAllComponents(inList, inComponentType, inPartType)); }
public static List <CarPartComponent> GetAllComponents(List <CarPartComponent> inList, CarPartComponent.ComponentType inComponentType, CarPart.PartType inPartType) { List <CarPartComponent> carPartComponentList = new List <CarPartComponent>(); for (int index = 0; index < inList.Count; ++index) { CarPartComponent carPartComponent = inList[index]; if (carPartComponent.componentType == inComponentType && carPartComponent.partsAvailableTo.Contains(inPartType)) { carPartComponentList.Add(carPartComponent); } } return(carPartComponentList); }