Add: JavaDoc for Order5
This commit is contained in:
@@ -7,11 +7,32 @@ import java.util.ArrayList;
|
|||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
|
|
||||||
public class Order5 extends OrderLogicCard {
|
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
|
||||||
|
*/
|
||||||
public Order5(ArrayList<Player> players) throws NoSuchElementException{
|
public Order5(ArrayList<Player> players) throws NoSuchElementException{
|
||||||
if(players.size()!=5)
|
if(players.size()!=5)
|
||||||
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 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}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void effect(Player player,int index) throws IndexOutOfBoundsException
|
protected void effect(Player player,int index) throws IndexOutOfBoundsException
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user