added a method in 'Player' to return the first 'PowerCard' of a specific Type

This commit is contained in:
Hanno Fleischer
2024-12-06 00:30:08 +01:00
parent 50f9c0ef0c
commit a92c06a70e

View File

@@ -137,6 +137,21 @@ public boolean isFinished() {
return true;
}
/**
* This method returns a
*
* @param bonusCard
* @return
*/
public PowerCard getPowerCardByType(BonusCard bonusCard) {
for (PowerCard card : this.handCards) {
if(card.getCard().equals(bonusCard)) {
return card;
}
}
return null;
}
/**
* This method returns the give name of the Player
*