mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-01-31 23:29:36 +01:00
Gjør det mulig å sjekke om to programmeringskort er like
This commit is contained in:
parent
cad7677bc6
commit
4a885f9fc0
@ -41,6 +41,15 @@ public class ProgrammingCard implements Comparable<ProgrammingCard> {
|
|||||||
return this.getPriority() + " " + this.cardAction.toString();
|
return this.getPriority() + " " + this.cardAction.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object other) {
|
||||||
|
if (!(other instanceof ProgrammingCard)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
ProgrammingCard otherCard = (ProgrammingCard) other;
|
||||||
|
return otherCard.cardAction == this.cardAction && otherCard.cardPriority == this.cardPriority;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(ProgrammingCard programmingCard) {
|
public int compareTo(ProgrammingCard programmingCard) {
|
||||||
return programmingCard.cardPriority - this.cardPriority;
|
return programmingCard.cardPriority - this.cardPriority;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user