From a2d9c964f5347271593835ff4b9dd585a1bb2cdd Mon Sep 17 00:00:00 2001 From: MatteoPellegrino05 Date: Sun, 12 Apr 2026 19:20:12 +0200 Subject: [PATCH] Add: JavaDoc for Order3 --- .../polimi/ingsw/gc14/Model/Orders/Order3.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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 f0144fb..81ec8a0 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 @@ -7,11 +7,29 @@ import java.util.ArrayList; import java.util.NoSuchElementException; 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 + */ public Order3(ArrayList players) throws NoSuchElementException{ if(players.size()!=3) throw new NoSuchElementException(); super(players); } + + /** + * 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. + * + * @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 {