mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-01-11 20:55:40 -08:00
Remove redundant Card record code
Java Records automatically acquire an implementation of equals and hashCode that accounts for their components. They also have read accessors for their components (card.suit() to get the suit).
This commit is contained in:
@@ -105,7 +105,7 @@ public class Player {
|
||||
// Can't split twice
|
||||
return false;
|
||||
} else {
|
||||
boolean isPair = this.hand.get(0).getValue() == this.hand.get(1).getValue();
|
||||
boolean isPair = this.hand.get(0).value() == this.hand.get(1).value();
|
||||
return isPair;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user