| | | 1 | | //======================================================================= |
| | | 2 | | // ColliderRegistry.ReplayOrderComparer.cs |
| | | 3 | | //======================================================================= |
| | | 4 | | // MIT License, Copyright (c) 2026-present David Oravsky (mrdav30) |
| | | 5 | | // See LICENSE file in the project root for full license information. |
| | | 6 | | //======================================================================= |
| | | 7 | | |
| | | 8 | | using System.Collections.Generic; |
| | | 9 | | using System.Runtime.CompilerServices; |
| | | 10 | | using Gravitas.Colliders; |
| | | 11 | | |
| | | 12 | | namespace Gravitas; |
| | | 13 | | |
| | | 14 | | /// <summary> |
| | | 15 | | /// Compares registered colliders by their recorded registration order. |
| | | 16 | | /// </summary> |
| | | 17 | | internal readonly struct ReplayOrderComparer<TCollider> : IComparer<TCollider> |
| | | 18 | | where TCollider : class, IPhysicsColliderRegistryItem |
| | | 19 | | { |
| | | 20 | | [MethodImpl(MethodImplOptions.AggressiveInlining)] |
| | | 21 | | public int Compare(TCollider? x, TCollider? y) => |
| | 23832 | 22 | | x!.ReplayOrder.CompareTo(y!.ReplayOrder); |
| | | 23 | | } |