Aetheria/Assets/Plugins/MSAGL/Layout/Layered/Ordering/EdgeComparerByTarget.cs
Reinier Vens dbc522a224 Weapos Rejiggered
Modified weapon scripts to eliminate specialized projectile behavior - allows charged weapons to have projectiles and modify weapon stats when charged
Added machine gun weapon & VFX
Moved third party code to Plugins folder to improve compile times
2021-01-31 03:52:32 +00:00

27 lines
841 B
C#

using System.Collections.Generic;
using Microsoft.Msagl.Core;
namespace Microsoft.Msagl.Layout.Layered {
internal class EdgeComparerByTarget : IComparer<LayerEdge> {
int[] X;
internal EdgeComparerByTarget(int[] X) {
this.X = X;
}
#if SHARPKIT //http://code.google.com/p/sharpkit/issues/detail?id=203
//SharpKit/Colin - https://code.google.com/p/sharpkit/issues/detail?id=290
public int Compare(LayerEdge a, LayerEdge b) {
#else
int System.Collections.Generic.IComparer<LayerEdge>.Compare(LayerEdge a, LayerEdge b) {
#endif
ValidateArg.IsNotNull(a, "a");
ValidateArg.IsNotNull(b, "b");
int r = X[a.Target] - X[b.Target];
if (r != 0)
return r;
return X[a.Source] - X[b.Source];
}
}
}