diff --git a/Projektgruppe_175/src/game/goals/CaptureTheFlagGoal.java b/Projektgruppe_175/src/game/goals/CaptureTheFlagGoal.java index 00fbfc9..9a2e105 100644 --- a/Projektgruppe_175/src/game/goals/CaptureTheFlagGoal.java +++ b/Projektgruppe_175/src/game/goals/CaptureTheFlagGoal.java @@ -21,10 +21,20 @@ public class CaptureTheFlagGoal extends Goal { int numFlagCastles; private static Random random = new Random(); + + /** + * Generates a random integer in this interval + * @param min The minimum number + * @param max The maximum number + * @return The random number + */ private static int newRandomInt(int min, int max) { return min + random.nextInt(max - min + 1); } + /** + * Creates a new capture the flag goal + */ public CaptureTheFlagGoal() { super("Capture the flag", "Derjenige Spieler gewinnt, der zuerst" + " alle weiß umrandeten Flaggen-Schlösser erobert."); @@ -104,6 +114,11 @@ public class CaptureTheFlagGoal extends Goal { } + /** + * Returns whether this castle is a flag castle + * @param castle The castle + * @return true if the castle is a flag castle, false otherwise + */ public boolean isFlagCastle(Castle castle) { return flagCastles.contains(castle); diff --git a/Projektgruppe_175/src/game/goals/ConquerGoal.java b/Projektgruppe_175/src/game/goals/ConquerGoal.java index 3b49b75..1a0e03c 100644 --- a/Projektgruppe_175/src/game/goals/ConquerGoal.java +++ b/Projektgruppe_175/src/game/goals/ConquerGoal.java @@ -7,6 +7,9 @@ import game.map.Castle; public class ConquerGoal extends Goal { + /** + * Constructs a new conquer goal + */ public ConquerGoal() { super("Eroberung", "Derjenige Spieler gewinnt, der als erstes alle Gebiete erobert hat."); } diff --git a/Projektgruppe_175/src/game/goals/PopulationGoal.java b/Projektgruppe_175/src/game/goals/PopulationGoal.java index b217820..7d0f02f 100644 --- a/Projektgruppe_175/src/game/goals/PopulationGoal.java +++ b/Projektgruppe_175/src/game/goals/PopulationGoal.java @@ -15,6 +15,9 @@ public class PopulationGoal extends Goal { private int populationNeeded = 10; private int castlesNeeded = 5; + /** + * Creates a new population goal + */ public PopulationGoal() { super("Bevölkerung", "Derjenige Spieler gewinnt, der als erstes jeweils 10 Truppen auf 5 Burgen bringt"); } diff --git a/Projektgruppe_175/src/game/goals/TimeGoal.java b/Projektgruppe_175/src/game/goals/TimeGoal.java index 3a1f2b4..48caf05 100644 --- a/Projektgruppe_175/src/game/goals/TimeGoal.java +++ b/Projektgruppe_175/src/game/goals/TimeGoal.java @@ -13,10 +13,17 @@ public class TimeGoal extends Goal { int maxRounds; + /** + * Creates a new time goal with the default limit + */ public TimeGoal() { this(4); } + /** + * Creates a new time goal with the specified limit + * @param maxRounds The limit of rounds + */ public TimeGoal(int maxRounds) { super("Countdown", "Derjenige Spieler gewinnt, der nach " + maxRounds + " Runden die meisten Burgen besitzt."); this.maxRounds = maxRounds;