diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Orders/Order2.java b/src/main/java/it/polimi/ingsw/gc14/Model/Orders/Order2.java index e27dc37..1288aee 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Model/Orders/Order2.java +++ b/src/main/java/it/polimi/ingsw/gc14/Model/Orders/Order2.java @@ -1,6 +1,5 @@ package it.polimi.ingsw.gc14.Model.Orders; -import it.polimi.ingsw.gc14.Model.Cards.BuildingCard; import it.polimi.ingsw.gc14.Model.OrderLogicCard; import it.polimi.ingsw.gc14.Model.Player; @@ -11,8 +10,8 @@ public class Order2 extends OrderLogicCard { /** * Creates an Order2 logic card for a two-player game. * - * @param players the list of players associated with this order card - * @throws NoSuchElementException if the number of players is not equal to 2 + * @param players the list of players associated with this order card. + * @throws NoSuchElementException if the number of players is not equal to 2. */ public Order2(ArrayList players)throws NoSuchElementException { if(players.size()!=2) @@ -23,13 +22,13 @@ public class Order2 extends OrderLogicCard { /** * Applies the effect associated with the specified position index for the given player. - * If {@code index == 0}, the player gains 1 Food and the building effect is applied. - * If {@code index == 1}, the player tries to remove 1 Food; if the player cannot remove it, + *

If {@code index == 0}, the player gains 1 Food and the building effect is applied. + *

If {@code index == 1}, the player tries to remove 1 Food; if the player cannot remove it, * the player loses 2 Prestige. * - * @param player the player to whom the effect is applied - * @param index the position index of the effect to apply - * @throws IndexOutOfBoundsException if {@code index < 0} or {@code index >= 2} + * @param player the player to whom the effect is applied. + * @param index the position index of the effect to apply. + * @throws IndexOutOfBoundsException if {@code index < 0} or {@code index >= 2}. */ @Override protected void effect(Player player,int index) throws IndexOutOfBoundsException @@ -47,7 +46,6 @@ public class Order2 extends OrderLogicCard { if(index==1){ if(!player.removeFood(1)){ player.removePrestige(2); - return; } } } diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Orders/Order3.java b/src/main/java/it/polimi/ingsw/gc14/Model/Orders/Order3.java index 81ec8a0..fc7f6d2 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Model/Orders/Order3.java +++ b/src/main/java/it/polimi/ingsw/gc14/Model/Orders/Order3.java @@ -11,8 +11,8 @@ public class Order3 extends OrderLogicCard { /** * Creates an Order3 logic card for a three-player game. * - * @param players the list of players associated with this order card - * @throws NoSuchElementException if the number of players is not equal to 3 + * @param players the list of players associated with this order card. + * @throws NoSuchElementException if the number of players is not equal to 3. */ public Order3(ArrayList players) throws NoSuchElementException{ if(players.size()!=3) @@ -22,13 +22,13 @@ public class Order3 extends OrderLogicCard { /** * Applies the effect associated with the specified position index for the given player. - * If {@code index == 0}, the player gains 2 Food and the building effect is applied. - * If {@code index == 1}, no effect is applied. - * If {@code index == 2}, if the player can remove 1 Food, the player loses 2 Prestige. + *

If {@code index == 0}, the player gains 2 Food and the building effect is applied. + *

If {@code index == 1}, no effect is applied. + *

If {@code index == 2}, if the player can remove 1 Food, the player loses 2 Prestige. * - * @param player the player to whom the effect is applied - * @param index the position index of the effect to apply - * @throws IndexOutOfBoundsException if {@code index < 0} or {@code index >= 3} + * @param player the player to whom the effect is applied. + * @param index the position index of the effect to apply. + * @throws IndexOutOfBoundsException if {@code index < 0} or {@code index >= 3}. */ @Override protected void effect(Player player,int index) throws IndexOutOfBoundsException @@ -47,7 +47,6 @@ public class Order3 extends OrderLogicCard { if(player.removeFood(1)){ player.removePrestige(2); } - return; } } } \ No newline at end of file diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Orders/Order4.java b/src/main/java/it/polimi/ingsw/gc14/Model/Orders/Order4.java index d28acfb..06bb44a 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Model/Orders/Order4.java +++ b/src/main/java/it/polimi/ingsw/gc14/Model/Orders/Order4.java @@ -11,8 +11,8 @@ public class Order4 extends OrderLogicCard { /** * Creates an Order4 logic card for a four-player game. * - * @param players the list of players associated with this order card - * @throws NoSuchElementException if the number of players is not equal to 4 + * @param players the list of players associated with this order card. + * @throws NoSuchElementException if the number of players is not equal to 4. */ public Order4(ArrayList players)throws NoSuchElementException { if(players.size()!=4) @@ -22,15 +22,15 @@ public class Order4 extends OrderLogicCard { /** * Applies the effect associated with the specified position index for the given player. - * If {@code index == 0}, the player gains 2 Food and the building effect is applied. - * If {@code index == 1}, the player gains 1 Food and the building effect is applied. - * If {@code index == 2}, no effect is applied. - * If {@code index == 3}, the player tries to remove 1 Food; if the removal succeeds, + *

If {@code index == 0}, the player gains 2 Food and the building effect is applied. + *

If {@code index == 1}, the player gains 1 Food and the building effect is applied. + *

If {@code index == 2}, no effect is applied. + *

If {@code index == 3}, the player tries to remove 1 Food; if the removal succeeds, * the player loses 2 Prestige. * - * @param player the player to whom the effect is applied - * @param index the position index of the effect to apply - * @throws IndexOutOfBoundsException if {@code index < 0} or {@code index >= 4} + * @param player the player to whom the effect is applied. + * @param index the position index of the effect to apply. + * @throws IndexOutOfBoundsException if {@code index < 0} or {@code index >= 4}. */ @Override protected void effect(Player player,int index) throws IndexOutOfBoundsException @@ -55,7 +55,6 @@ public class Order4 extends OrderLogicCard { if(player.removeFood(1)){ player.removePrestige(2); } - return; } } } \ No newline at end of file diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/Orders/Order5.java b/src/main/java/it/polimi/ingsw/gc14/Model/Orders/Order5.java index 364d1e6..41b7228 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Model/Orders/Order5.java +++ b/src/main/java/it/polimi/ingsw/gc14/Model/Orders/Order5.java @@ -11,8 +11,8 @@ public class Order5 extends OrderLogicCard { /** * Creates an Order5 logic card for a five-player game. * - * @param players the list of players associated with this order card - * @throws NoSuchElementException if the number of players is not equal to 5 + * @param players the list of players associated with this order card. + * @throws NoSuchElementException if the number of players is not equal to 5. */ public Order5(ArrayList players) throws NoSuchElementException{ if(players.size()!=5) @@ -22,16 +22,16 @@ public class Order5 extends OrderLogicCard { /** * Applies the effect associated with the specified position index for the given player. - * If {@code index == 0}, the player gains 3 Food and the building effect is applied. - * If {@code index == 1}, the player gains 1 Food and the building effect is applied. - * If {@code index == 2}, no effect is applied. - * If {@code index == 3}, no effect is applied. - * If {@code index == 4}, the player tries to remove 1 Food; if the removal succeeds, + *

If {@code index == 0}, the player gains 3 Food and the building effect is applied. + *

If {@code index == 1}, the player gains 1 Food and the building effect is applied. + *

If {@code index == 2}, no effect is applied. + *

If {@code index == 3}, no effect is applied. + *

If {@code index == 4}, the player tries to remove 1 Food; if the removal succeeds, * the player loses 2 Prestige. * - * @param player the player to whom the effect is applied - * @param index the position index of the effect to apply - * @throws IndexOutOfBoundsException if {@code index < 0} or {@code index >= 5} + * @param player the player to whom the effect is applied. + * @param index the position index of the effect to apply. + * @throws IndexOutOfBoundsException if {@code index < 0} or {@code index >= 5}. */ @Override protected void effect(Player player,int index) throws IndexOutOfBoundsException @@ -56,7 +56,6 @@ public class Order5 extends OrderLogicCard { if(player.removeFood(1)){ player.removePrestige(2); } - return; } } }