private void GetClothes(List<string> arr, List<ClothesPart> Arr, string partName) { string lastType = ""; foreach (string path in arr) { String[] textSplit = path.Split("_"[0]); if (partName == textSplit[0]) { ClothesPart part = new ClothesPart(); part.sex = textSplit[1]; part.style = textSplit[2]; part.type = textSplit[3]; if (lastType != part.style + "_" + part.type) Arr.Add(part); lastType = part.style + "_" + part.type; } } }
private void GetClothes(List <string> arr, List <ClothesPart> Arr, string partName) { string lastType = ""; foreach (string path in arr) { String[] textSplit = path.Split("_"[0]); if (partName == textSplit[0]) { ClothesPart part = new ClothesPart(); part.sex = textSplit[1]; part.style = textSplit[2]; part.type = textSplit[3]; if (lastType != part.style + "_" + part.type) { Arr.Add(part); } lastType = part.style + "_" + part.type; } } }