librejack

Blackjack clone written in java
git clone https://github.com/michaelneuper/librejack.git
README | Files | Log | Refs | LICENSE

commit d193b43e02ff2bea2f7630cfa70ab4337e64e78d
parent 3e7b6deeddaee23f322a9a1d564bb70ba72de871
Author: Michael Neuper <73108749+michaelneuper@users.noreply.github.com>
Date:   Fri,  7 Oct 2022 19:56:35 +0200

Add new constructor

Diffstat:
Msrc/model/Card.java | 14+++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/model/Card.java b/src/model/Card.java @@ -59,7 +59,7 @@ public class Card { private Rank rank; /** - * Card constructor: + * Card Constructor: * Creates a card given a suit and rank * * @param suit Card suit @@ -70,6 +70,12 @@ public class Card { this.rank = rank; } + /** + * Card Constructor: + * Creates a new card as a copy of another card + * + * @param card card to be added + */ public Card(Card card) { this.suit = card.getSuit(); this.rank = card.getRank(); @@ -77,8 +83,6 @@ public class Card { /** * Rank value getter method - * - * @return card rank value */ public int getValue() { return this.rank.rankValue; @@ -94,7 +98,8 @@ public class Card { @Override public String toString() { + return "[" + rank + " of " + suit + "](" + this.getValue() + ")"; } -} -\ No newline at end of file +}