Add: JavaDoc for Order3

This commit is contained in:
MatteoPellegrino05
2026-04-12 19:20:12 +02:00
parent a25218af09
commit a2d9c964f5
@@ -7,11 +7,29 @@ import java.util.ArrayList;
import java.util.NoSuchElementException; import java.util.NoSuchElementException;
public class Order3 extends OrderLogicCard { 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<Player> players) throws NoSuchElementException{ public Order3(ArrayList<Player> players) throws NoSuchElementException{
if(players.size()!=3) if(players.size()!=3)
throw new NoSuchElementException(); throw new NoSuchElementException();
super(players); 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 @Override
protected void effect(Player player,int index) throws IndexOutOfBoundsException protected void effect(Player player,int index) throws IndexOutOfBoundsException
{ {