/// <summary> /// sortiraj od najveceg do najmanjeg /// </summary> public void SortToLowest() { if (listItemChangeable.Count != 0 && listItemChangeable != null) { DeleteSlots(); #region sortiranje itema za upis u inventory Item[] sortedItems = new Item[listItemChangeable.Count]; for (int i = 0; i < listItemChangeable.Count; i++) { sortedItems[i] = listItemChangeable[i]; } CountingSort countSort = new CountingSort(); sortedItems = countSort.SortToLow(sortedItems); for (int i = 0; i < sortedItems.Length; i++) { listItemChangeable[i] = sortedItems[i]; } //listItemChangeable.Reverse(); #endregion AddToInventory(listItemChangeable); } }