Skip to content

Commit

Permalink
Fix minor bugs in SortedArrayList and DefaultGroupPlacementStrategy.
Browse files Browse the repository at this point in the history
  • Loading branch information
homothetyhk committed Jan 16, 2022
1 parent ca06a0e commit 2530467
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions RandomizerCore/Collections/SortedArrayList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ public bool Contains(T item)
public void CopyTo(T[] array, int arrayIndex)
{
ts.CopyTo(array, arrayIndex);
Array.Reverse(array, arrayIndex, ts.Count);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public virtual List<RandoPlacement> PlaceCoupledGroup(CoupledRandomizationGroup
}
else dualMeanSphereProgressionPriorities.Add(int.MinValue);

dualLocations.Add(new SortedArrayList<IRandoLocation>(sd.Locations));
dualLocations.Add(new SortedArrayList<IRandoLocation>(sd.Locations, ComparerUtil.LocationComparer, ComparerUtil.LocationEqualityComparer));
}

SortedArrayList<IRandoItem> remainingItems = new(dualLocations.SelectMany(l => l.Cast<IRandoItem>()), ComparerUtil.ItemComparer, ComparerUtil.ItemEqualityComparer);
Expand Down

0 comments on commit 2530467

Please sign in to comment.