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 CarPartComponentsManager() { Instance = this; try { var uri = new Uri("pack://application:,,,/Assets/Part Components.txt"); System.Windows.Resources.StreamResourceInfo resourceStream = Application.GetResourceStream(uri); using (var reader = new StreamReader(resourceStream.Stream)) { string traitsText = reader.ReadToEnd(); List <DatabaseEntry> result = DatabaseReader.LoadFromText(traitsText); LoadComponentsData(result); } } catch (Exception e) { Console.WriteLine(e); //throw; } }