Class Order2

java.lang.Object
it.polimi.ingsw.gc14.Model.OrderLogicCard
it.polimi.ingsw.gc14.Model.Orders.Order2
All Implemented Interfaces:
Serializable

public class Order2 extends OrderLogicCard
Represents the order logic card used in a two-player game.

This class defines the specific turn-order behavior for games with two players.

See Also:
  • Constructor Details

  • Method Details

    • effect

      protected void effect(Player player, int index) throws IndexOutOfBoundsException
      Applies the effect associated with the specified position index for the given player.

      If index == 0, the player gains 1 Food and the building effect is applied.

      If index == 1, the player tries to remove 1 Food; if the player cannot pay it, the player loses 2 Prestige.

      Specified by:
      effect in class OrderLogicCard
      Parameters:
      player - the player to whom the effect is applied.
      index - the position index of the effect to apply.
      Throws:
      IndexOutOfBoundsException - if index < 0 or index >= 2.
    • toString

      public String toString()
      Creates the TURN ORDER box of the TUI.
      Overrides:
      toString in class Object
      Returns:
      the string containing the box