- * TODO: (your documentation)
*
- * @author TODO
+ * @author Andrin Fassbind, Leonardo Brandenberger, Roman Schenk, Stefan Amador
*/
public class SiedlerGame {
static final int FOUR_TO_ONE_TRADE_OFFER = 4;
@@ -74,7 +72,14 @@ public class SiedlerGame {
}
}
- //TODO JavaDoc
+ /**
+ * This methode is used to add resources to the player.
+ *
+ * @param player the active Player
+ * @param resource the resource to add
+ * @param numberToAdd the quantity of resources to add
+ * @return true if resource has been added else false
+ */
private boolean addResourcesToPlayer(Player player, Config.Resource resource, int numberToAdd) {
if (bank.getResourceFromBank(resource, numberToAdd)) {
player.addResource(resource, numberToAdd);
@@ -83,7 +88,14 @@ public class SiedlerGame {
return false;
}
- //TODO JavaDoc
+ /**
+ * This methode is used to subtract resources from Player
+ *
+ * @param player the active player
+ * @param resource the resource to subtract
+ * @param numberToSubtract the quantity of resource to subtract
+ * @return true if resource has been subtracted
+ */
private boolean subtractResourceFromPlayer(Player player, Config.Resource resource, int numberToSubtract) {
if (player.subtractResource(resource, numberToSubtract)) {
bank.storeResourceToBank(resource, numberToSubtract);
@@ -234,7 +246,11 @@ public class SiedlerGame {
return null;
}
- //TODO JavaDoc
+ /**
+ * This method handles the case if a 7 has been diced.
+ *
+ * @param player the active player who rolls the dice.
+ */
public void handleDiceThrow7(Player player) {
ArrayList