mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Added .equals(other) and .hashCode() methods to TargetAddress
This commit is contained in:
parent
601e442208
commit
6fbe6be3fb
1 changed files with 12 additions and 1 deletions
|
@ -38,7 +38,7 @@ import mage.target.Target;
|
|||
|
||||
|
||||
/**
|
||||
* @author duncancmt
|
||||
* @author duncant
|
||||
*/
|
||||
public class TargetAddress {
|
||||
protected int spellAbilityIndex;
|
||||
|
@ -176,4 +176,15 @@ public class TargetAddress {
|
|||
}
|
||||
return card.getSpellAbility();
|
||||
}
|
||||
|
||||
public boolean equals(TargetAddress other) {
|
||||
return spellAbilityIndex == other.spellAbilityIndex
|
||||
&& mode.equals(other.mode)
|
||||
&& targetIndex == other.targetIndex;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return spellAbilityIndex ^ mode.hashCode() ^ targetIndex;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue