check shipyard on equals starport
This commit is contained in:
@@ -32,4 +32,18 @@ public class Shipyard {
|
|||||||
ships.addAll(unavailables);
|
ships.addAll(unavailables);
|
||||||
return ships;
|
return ships;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) return true;
|
||||||
|
if (o == null || getClass() != o.getClass()) return false;
|
||||||
|
Shipyard shipyard = (Shipyard) o;
|
||||||
|
return Objects.equals(items, shipyard.items) &&
|
||||||
|
Objects.equals(unavailables, shipyard.unavailables);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(items, unavailables);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package ru.trader.edce.entities;
|
package ru.trader.edce.entities;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
public class ShipyardItem {
|
public class ShipyardItem {
|
||||||
private long id;
|
private long id;
|
||||||
private String name;
|
private String name;
|
||||||
@@ -37,4 +39,18 @@ public class ShipyardItem {
|
|||||||
", basevalue=" + basevalue +
|
", basevalue=" + basevalue +
|
||||||
"} ";
|
"} ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) return true;
|
||||||
|
if (o == null || getClass() != o.getClass()) return false;
|
||||||
|
ShipyardItem that = (ShipyardItem) o;
|
||||||
|
return Objects.equals(id, that.id) &&
|
||||||
|
Objects.equals(basevalue, that.basevalue);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,7 +64,8 @@ public class Starport {
|
|||||||
if (o == null || getClass() != o.getClass()) return false;
|
if (o == null || getClass() != o.getClass()) return false;
|
||||||
Starport starport = (Starport) o;
|
Starport starport = (Starport) o;
|
||||||
return Objects.equals(id, starport.id) &&
|
return Objects.equals(id, starport.id) &&
|
||||||
Objects.equals(commodities, starport.commodities);
|
Objects.equals(commodities, starport.commodities) &&
|
||||||
|
Objects.equals(ships, starport.ships);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user