java.lang.Object
edu.ntnu.idatt1002.k01g08.fta.objects.team.Player

public class Player extends Object
Represents a football player.
  • Constructor Details

  • Method Details

    • getName

      public String getName()
      Returns the name of this player
      Returns:
      the name of this player
    • setName

      public void setName(String name)
      Sets the name of this player
      Parameters:
      name - the string to set this player's name to
    • getNumber

      public int getNumber()
      Returns the squad number of this player
      Returns:
      the squad number of this player
    • getRedCards

      public int getRedCards()
      Returns the number of red cards for this player
      Returns:
      the number of red cards for this player
    • getYellowCards

      public int getYellowCards()
      Returns the number of yellow cards for this player
      Returns:
      the number of yellow cards for this player
    • getGoals

      public int getGoals()
      Returns the number of scored goals for this player
      Returns:
      the number of scored goals for this player
    • getAssists

      public int getAssists()
      Returns the number of assists for this player
      Returns:
      the number of assists for this player
    • increaseRedCards

      public void increaseRedCards()
      Increments this player's number of red cards
    • increaseRedCards

      public void increaseRedCards(int number)
      Increases this player's number of red cards.
      Parameters:
      number - the number to increase this player's red cards by
    • increaseYellowCards

      public void increaseYellowCards()
      Increments this player's number of yellow cards
    • increaseYellowCards

      public void increaseYellowCards(int number)
      Increases this player's number of yellow cards.
      Parameters:
      number - the number to increase this player's yellow cards by
    • increaseGoals

      public void increaseGoals()
      Increments this player's number of scored goals
    • increaseGoals

      public void increaseGoals(int number)
      Increases this player's number of scored goals.
      Parameters:
      number - the number to increase this player's goals by
    • increaseAssists

      public void increaseAssists()
      Increments this player's number of assists
    • increaseAssists

      public void increaseAssists(int number)
      Increases this player's number of assists.
      Parameters:
      number - the number to increase this player's assists by
    • toString

      public String toString()
      Overrides:
      toString in class Object