From 7f3376c1a47e3f2973e8d1c387fd5868c0e92c6b Mon Sep 17 00:00:00 2001 From: Leonardo Brandenberger Date: Fri, 10 Dec 2021 11:11:19 +0100 Subject: [PATCH] Finished Player Class (Java Doc and Code Style) --- src/ch/zhaw/catan/Player.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/ch/zhaw/catan/Player.java b/src/ch/zhaw/catan/Player.java index dc1f8a8..366270f 100644 --- a/src/ch/zhaw/catan/Player.java +++ b/src/ch/zhaw/catan/Player.java @@ -4,10 +4,10 @@ import java.util.HashMap; import java.util.List; /** - * This class is here in order to maintain the resources of the players, the amount of structures that they can build, - * control to see if a player has enough to build a new structure and to add them into a faction. + * This class is here in order to maintain the resources of the players, the amount of structures that they can build. + * And check if a player holds enough resources to build. * - * @author Leonardo Brandenberger, Roman Schrom, Andrin Fassbind, Stefan Amador + * @author Leonardo Brandenberger, Roman Schenk, Andrin Fassbind, Stefan Amador */ public class Player { @@ -18,7 +18,7 @@ public class Player { /** * The constructor initializes the faction and the Hashmaps resources and structureToUse. * - * @param faction this is the faction of the player. + * @param faction faction of the player. */ public Player(Config.Faction faction) { //Data fields @@ -36,7 +36,7 @@ public class Player { } /** - * This method returns all the resources the player has at the moment + * This method returns all the resources the player has at the moment. * * @return HashMap with the count of every resource */ @@ -45,7 +45,7 @@ public class Player { } /** - * This method returns player faction + * This method returns the player's faction. * * @return the faction of the player. */ @@ -56,15 +56,15 @@ public class Player { /** * This method returns the amount of a specific resource that a player owns. * - * @param resource the resource that is needed. - * @return the amount of the specific resource. + * @param resource the resource that is needed + * @return the amount of the specific resource */ public int getSpecificResource(Config.Resource resource) { return resources.get(resource); } /** - * This method adds a specific resource to resources + * This method adds a specific resource to resources of the player. * * @param resource to add * @param numberToAdd how much to add @@ -91,7 +91,7 @@ public class Player { /** * This method has to be used when a player wants to build a structure. It checks if a player has enough of the specific structure - * and resources to build one more. If the player is able to build, this method subtracts the building cost from the resources + * and resources to build . If the player is able to build, this method subtracts the building cost from the resources * in possession by the player. * It reduces the amount of the specific structure a player can build by 1. *