Remove IEquatable from ActorBoundsPair.

This commit is contained in:
Paul Chote
2020-02-28 21:17:51 +00:00
committed by atlimit8
parent 2b6c104011
commit 4ba50a4379

View File

@@ -18,7 +18,7 @@ using OpenRA.Primitives;
namespace OpenRA.Traits
{
public struct ActorBoundsPair : IEquatable<ActorBoundsPair>
public struct ActorBoundsPair
{
public readonly Actor Actor;
@@ -27,14 +27,8 @@ namespace OpenRA.Traits
public ActorBoundsPair(Actor actor, Rectangle bounds) { Actor = actor; Bounds = bounds; }
public static bool operator ==(ActorBoundsPair me, ActorBoundsPair other) { return me.Actor == other.Actor && Equals(me.Bounds, other.Bounds); }
public static bool operator !=(ActorBoundsPair me, ActorBoundsPair other) { return !(me == other); }
public override int GetHashCode() { return Actor.GetHashCode() ^ Bounds.GetHashCode(); }
public bool Equals(ActorBoundsPair other) { return this == other; }
public override bool Equals(object obj) { return obj is ActorBoundsPair && Equals((ActorBoundsPair)obj); }
public override string ToString() { return "{0}->{1}".F(Actor.Info.Name, Bounds.GetType().Name); }
}