Skip to content

Commit

Permalink
Remove equals implementations from IDrawables (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
miozune authored Feb 18, 2025
1 parent 7988ecd commit fde52cc
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,5 @@ public DrawableWidget(IDrawable drawable) {
public void draw(ModularGuiContext context, WidgetTheme widgetTheme) {
this.drawable.drawAtZero(context, getArea(), widgetTheme);
}

@Override
public boolean equals(Object obj) {
if (obj instanceof IDrawable drawable)
return this.drawable == drawable;
else if (obj instanceof DrawableWidget drawableWidget)
return this.drawable == drawableWidget.drawable;

return false;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,6 @@ public String toString() {
return getFormatted();
}

@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (!(obj instanceof IKey key)) return false;
return getFormatted().equals(key.getFormatted());
}

@Override
public int hashCode() {
throw new NotImplementedException("Implement hashCode() in subclasses");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,4 @@ public DynamicKey(Supplier<String> supplier) {
public String get() {
return this.supplier.get();
}

@Override
public boolean equals(Object obj) {
return this == obj || (obj instanceof DynamicKey dynamicKey && dynamicKey.supplier == this.supplier);
}
}

0 comments on commit fde52cc

Please sign in to comment.