Skip to content

Commit

Permalink
review shuffle
Browse files Browse the repository at this point in the history
  • Loading branch information
ike709 committed Oct 24, 2024
1 parent a975cdf commit 4f5db27
Showing 1 changed file with 24 additions and 33 deletions.
57 changes: 24 additions & 33 deletions OpenDreamClient/Interface/DMF/IDMFProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,38 +222,20 @@ public bool Equals(string comparison) {
return comparisonVec.X == X && comparisonVec.Y == Y;
}

public bool Equals(DMFPropertyVec2 other)
{
public bool Equals(DMFPropertyVec2 other) {
return X == other.X && Y == other.Y && Delim == other.Delim;
}

public override bool Equals(object? obj)
{
public override bool Equals(object? obj) {
return obj is DMFPropertyVec2 other && Equals(other);
}

public override int GetHashCode()
{
public override int GetHashCode() {
return HashCode.Combine(X, Y, Delim);
}
}

public struct DMFPropertySize : IDMFProperty, IEquatable<DMFPropertySize> {
public bool Equals(DMFPropertySize other)
{
return _value.Equals(other._value);
}

public override bool Equals(object? obj)
{
return obj is DMFPropertySize other && Equals(other);
}

public override int GetHashCode()
{
return _value.GetHashCode();
}

private DMFPropertyVec2 _value;
public int X {get => _value.X; set => _value.X = value;}
public int Y {get => _value.Y; set => _value.Y = value;}
Expand Down Expand Up @@ -320,26 +302,23 @@ public bool Equals(string comparison) {
return _value.Equals(comparison);
}

public static bool operator ==(DMFPropertySize a, DMFPropertySize b) => a.Vector == b.Vector;
public static bool operator !=(DMFPropertySize a, DMFPropertySize b) => a.Vector != b.Vector;
}

public struct DMFPropertyPos : IDMFProperty, IEquatable<DMFPropertyPos> {
public bool Equals(DMFPropertyPos other)
{
public bool Equals(DMFPropertySize other) {
return _value.Equals(other._value);
}

public override bool Equals(object? obj)
{
return obj is DMFPropertyPos other && Equals(other);
public override bool Equals(object? obj) {
return obj is DMFPropertySize other && Equals(other);
}

public override int GetHashCode()
{
public override int GetHashCode() {
return _value.GetHashCode();
}

public static bool operator ==(DMFPropertySize a, DMFPropertySize b) => a.Vector == b.Vector;
public static bool operator !=(DMFPropertySize a, DMFPropertySize b) => a.Vector != b.Vector;
}

public struct DMFPropertyPos : IDMFProperty, IEquatable<DMFPropertyPos> {
private DMFPropertyVec2 _value;
public int X => _value.X;
public int Y => _value.Y;
Expand Down Expand Up @@ -406,6 +385,18 @@ public bool Equals(string comparison) {
return _value.Equals(comparison);
}

public bool Equals(DMFPropertyPos other) {
return _value.Equals(other._value);
}

public override bool Equals(object? obj) {
return obj is DMFPropertyPos other && Equals(other);
}

public override int GetHashCode() {
return _value.GetHashCode();
}

public static bool operator ==(DMFPropertyPos a, DMFPropertyPos b) => a.Vector == b.Vector;
public static bool operator !=(DMFPropertyPos a, DMFPropertyPos b) => a.Vector != b.Vector;
}
Expand Down

0 comments on commit 4f5db27

Please sign in to comment.