private AssetBase[] SortAssetArray(AssetBase[] toArray, AssetBase[] results, int onNow) { if (onNow == 0) { results = new AssetBase[toArray.Length]; } int currentKing = 0; int count = 0; foreach (AssetBase ab in toArray) { if (int.Parse(ab.Description) >= int.Parse(toArray[currentKing].Description)) currentKing = count; count++; } if (results != null) results[onNow] = toArray[currentKing]; List<AssetBase> toArrayTemp = toArray.ToList(); toArrayTemp.RemoveAt(currentKing); toArray = toArrayTemp.ToArray(); if (toArray.Length >= 1) return SortAssetArray(toArray, results, ++onNow); return results; }