Class OrderPlayer

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

public class OrderPlayer extends Object implements Serializable
Represents a player entry in an order logic card.

Each entry stores the player and whether that player has already performed an action in the current order sequence.

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private boolean
    Indicates whether the player has already played.
    private final Player
    The player associated with this order entry.
  • Constructor Summary

    Constructors
    Constructor
    Description
    OrderPlayer(Player player, boolean played)
    Creates an order entry for the specified player.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the player associated with this order entry.
    boolean
    Returns whether the player has already played in this order sequence.
    void
    Marks this player as having played in the current order sequence.
    Returns a string containing the player's username and whether the player has already played.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • player

      private final Player player
      The player associated with this order entry.
    • played

      private boolean played
      Indicates whether the player has already played.
  • Constructor Details

    • OrderPlayer

      public OrderPlayer(Player player, boolean played)
      Creates an order entry for the specified player.
      Parameters:
      player - the player associated with this order entry.
      played - true if the player has already played; false otherwise.
  • Method Details

    • getPlayer

      public Player getPlayer()
      Returns the player associated with this order entry.
      Returns:
      the player.
    • isPlayed

      public boolean isPlayed()
      Returns whether the player has already played in this order sequence.
      Returns:
      true if the player has played; false otherwise.
    • markAsPlayed

      public void markAsPlayed()
      Marks this player as having played in the current order sequence.
    • toString

      public String toString()
      Returns a string containing the player's username and whether the player has already played.
      Overrides:
      toString in class Object
      Returns:
      the string containing the username and whether the player has played.