forked from MagicBane/Server
equals and hash defined for wpak pojos
This commit is contained in:
@@ -9,11 +9,11 @@
|
||||
package engine.wpak.data;
|
||||
|
||||
import engine.mbEnums;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.Objects;
|
||||
|
||||
public class Power {
|
||||
public String power_id;
|
||||
@@ -114,8 +114,22 @@ public class Power {
|
||||
public boolean isSkill(){
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isChant(){
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
if (this == o)
|
||||
return true;
|
||||
if (o == null || getClass() != o.getClass())
|
||||
return false;
|
||||
|
||||
Power power = (Power) o;
|
||||
return Objects.equals(power_id, power.power_id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return power_id.hashCode(); // Use only the id field for hashCode
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user