librejack

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

commit c46fc66258a975a38e4f7cb90f1c4f3fa09e242d
parent 4a3c6f5be0f050ec5547ad1623738af07abe8bc6
Author: Michael Neuper <michael@michaelneuper.com>
Date:   Thu, 27 Apr 2023 22:37:29 +0200

Add periods to javadoc

Diffstat:
Msrc/controller/Controller.java | 6+++---
Msrc/controller/Hand.java | 8++++----
Msrc/controller/LoginController.java | 4++--
Msrc/model/Card.java | 6+++---
Msrc/model/Dealer.java | 2+-
Msrc/model/Deck.java | 20++++++++++----------
Msrc/model/Person.java | 11+++++------
Msrc/model/Player.java | 4++--
Msrc/view/LoginGUI.java | 2+-
Msrc/view/MainGUI.java | 1+
10 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/src/controller/Controller.java b/src/controller/Controller.java @@ -22,7 +22,7 @@ public class Controller { private Statistics stats = new Statistics(); /** - * Controller Constructor: Initializes score to 0 + * Controller Constructor: Initializes score to 0. */ public Controller() { @@ -63,7 +63,7 @@ public class Controller { } /** - * Handles logic for each round + * Handles logic for each round. * */ public void startRound() { @@ -152,7 +152,7 @@ public class Controller { } /** - * Hits the player with a card + * Hits the player with a card. */ public void hitPlayer() { player.hit(deck, discarded); diff --git a/src/controller/Hand.java b/src/controller/Hand.java @@ -17,14 +17,14 @@ public class Hand { private ArrayList<Card> hand; /** - * Hand Constructor: Creates empty hand + * Hand Constructor: Creates empty hand. */ public Hand() { hand = new ArrayList<Card>(); } /** - * Adds a card from the deck to the hand + * Adds a card from the deck to the hand. * * @param deck deck to take card from */ @@ -33,7 +33,7 @@ public class Hand { } /** - * Method to calculate the value of a hand + * Method to calculate the value of a hand. * * @return value value of the hand */ @@ -68,7 +68,7 @@ public class Hand { } /** - * Discards hand to deck + * Discards hand to deck. * * @param discardDeck */ diff --git a/src/controller/LoginController.java b/src/controller/LoginController.java @@ -145,8 +145,8 @@ public class LoginController { /** * Checks the following conditions to determine whether a password is valid: - * - is at least 10 characters in length - has at least 1 special character - * - has at least 1 number - has at least 1 uppercase and lowercase letter + * - is at least 10 characters in length - has at least 1 special character. + * - has at least 1 number - has at least 1 uppercase and lowercase letter. * * @param password to be validated * @return true if password is valid, false otherwise diff --git a/src/model/Card.java b/src/model/Card.java @@ -1,7 +1,7 @@ package model; /** - * Represents a card and handles card operations + * Represents a card and handles card operations. * * @author Michael Neuper * <a href="mailto:michael@michaelneuper.com">michael@michaelneuper.com</a> @@ -60,7 +60,7 @@ public class Card { private Rank rank; /** - * Card Constructor: Creates a card given a suit and rank + * Card Constructor: Creates a card given a suit and rank. * * @param suit Card suit * @param rank Card rank @@ -71,7 +71,7 @@ public class Card { } /** - * Card Constructor: Creates a new card as a copy of another card + * Card Constructor: Creates a new card as a copy of another card. * * @param card card to be added */ diff --git a/src/model/Dealer.java b/src/model/Dealer.java @@ -10,7 +10,7 @@ package model; public class Dealer extends Person { /** - * Creates a new dealer + * Creates a new dealer. */ public Dealer() { super.setName("Dealer"); diff --git a/src/model/Deck.java b/src/model/Deck.java @@ -7,7 +7,7 @@ import model.Card.Rank; import model.Card.Suit; /** - * Holds multiple cards and performs operations such as shuffling the deck + * Holds multiple cards and performs operations such as shuffling the deck. * * @author Michael Neuper * <a href="mailto:michael@michaelneuper.com">michael@michaelneuper.com</a> @@ -24,7 +24,7 @@ public class Deck { } /** - * Populates empty deck with 52 cards by looping over each rank and value + * Populates empty deck with 52 cards by looping over each rank and value. */ public void populate() { @@ -37,7 +37,7 @@ public class Deck { } /** - * Shuffles deck + * Shuffles deck. */ public void shuffle() { @@ -57,7 +57,7 @@ public class Deck { } /** - * Method to add a card to the deck + * Method to add a card to the deck. * * @param inCard card the be added */ @@ -66,7 +66,7 @@ public class Deck { } /** - * Takes copy of first card from deck and removes card from deck + * Takes copy of first card from deck and removes card from deck. * * @return cardToTake card that was removed */ @@ -78,7 +78,7 @@ public class Deck { } /** - * Makes sure the deck we're hitting from has cards in it + * Makes sure the deck we're hitting from has cards in it. * * @return true (if the deck has cards in) * @return false (if the deck is empty) @@ -88,14 +88,14 @@ public class Deck { } /** - * Mehtod to empty the deck + * Mehtod to empty the deck. */ public void emptyDeck() { deck.clear(); } /** - * Adds arraylist of cards to deck + * Adds arraylist of cards to deck. * * @param cards arraylist of cards to be added to deck */ @@ -104,7 +104,7 @@ public class Deck { } /** - * Returns arraylist containing all the cards in the deck + * Returns arraylist containing all the cards in the deck. * * @return deck arraylist with the cards */ @@ -126,7 +126,7 @@ public class Deck { } /** - * @return deck.size() number of cards left in the deck + * @return deck.size() number of cards left in the deck. */ public int cardsLeft() { return deck.size(); diff --git a/src/model/Person.java b/src/model/Person.java @@ -3,7 +3,7 @@ package model; import controller.Hand; /** - * Parent class of the Player and Dealer Objects + * Parent class of the Player and Dealer Objects. * * @author Michael Neuper * <a href="mailto:michael@michaelneuper.com">michael@michaelneuper.com</a> @@ -14,7 +14,7 @@ public abstract class Person { private String name; /** - * Creates a person + * Creates a person. */ public Person() { this.hand = new Hand(); @@ -38,7 +38,7 @@ public abstract class Person { } /** - * Checks if a person has blackjack + * Checks if a person has blackjack. * * @return true (if player has a blackjack) * @return false (if player does not have a blackjack) @@ -48,15 +48,14 @@ public abstract class Person { } /** - * Prints a formatted version of the person's hand + * Prints a formatted version of the person's hand. */ - // TODO: remove print statement public String printHand() { return this.hand + "[" + this.hand.calculateValue() + "]"; } /** - * Checks if deck has cards and reloads deck if it ran out + * Checks if deck has cards and reloads deck if it ran out. * * @param deck deck to draw from * @param discard deck to discard to diff --git a/src/model/Player.java b/src/model/Player.java @@ -15,11 +15,11 @@ import java.util.Scanner; */ public class Player extends Person { - private double balance; // TODO: make public + private double balance; Scanner input = new Scanner(System.in); /** - * Creates a new player + * Creates a new player. */ public Player() { super.setName("Player"); diff --git a/src/view/LoginGUI.java b/src/view/LoginGUI.java @@ -4,7 +4,7 @@ import controller.LoginController; import java.util.Date; /** - * GUI for login screen + * GUI for login screen. * * @author Michael Neuper * <a href="mailto:michael@michaelneuper.com">michael@michaelneuper.com</a> diff --git a/src/view/MainGUI.java b/src/view/MainGUI.java @@ -7,6 +7,7 @@ import java.util.logging.Logger; import javax.swing.JOptionPane; /** + * Main GUI. * * @author Michael Neuper * <a href="mailto:michael@michaelneuper.com">michael@michaelneuper.com</a>