java.lang.Object
edu.ntnu.idatt1002.k01g08.fta.objects.events.GameEvent
Direct Known Subclasses:
Foul, Goal, Substitution

public abstract class GameEvent extends Object
Represents a game event which occurs during match-time Is an abstract superclass describing the commonalities of all subclasses.
  • Constructor Summary

    Constructors
    Constructor
    Description
    GameEvent(Player player, Team team, String timeStamp)
    Constructor to instantiate an object of a subclass of the 'GameEvent'
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract String
    Forces subclasses to define an implementation of a string describing the event
    Returns the player who is associated with this game event
    Returns the team that is associated with this game event
    Returns the string of a timestamp referring to when the game event occurred during a match
    void
    setPlayer(Player player)
    Setter to alter the player who is associated with this game event
    void
    setTeam(Team team)
    Setter to alter which team that is associated with this game event
    void
    setTimeStampOfMatchTime(String timeStampOfMatchTime)
    Setter to alter the timestamp associated with this event
    Returns a string representation of a GameEvent object

    Methods inherited from class java.lang.Object

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

  • Method Details

    • getTimeStampOfMatchTime

      public String getTimeStampOfMatchTime()
      Returns the string of a timestamp referring to when the game event occurred during a match
      Returns:
      string timeStamp which
    • setTimeStampOfMatchTime

      public void setTimeStampOfMatchTime(String timeStampOfMatchTime) throws IllegalArgumentException, NullPointerException
      Setter to alter the timestamp associated with this event
      Parameters:
      timeStampOfMatchTime - is a string representation of the time of which
      Throws:
      IllegalArgumentException - if the timeStamp string .isBlank()
      NullPointerException - if the timeStamp string has the value 'null'
    • getEvent

      public abstract String getEvent()
      Forces subclasses to define an implementation of a string describing the event
      Returns:
      GameEvent value
    • getPlayer

      public Player getPlayer()
      Returns the player who is associated with this game event
      Returns:
      Player player
    • setPlayer

      public void setPlayer(Player player)
      Setter to alter the player who is associated with this game event
      Parameters:
      player - is a Player
    • getTeam

      public Team getTeam()
      Returns the team that is associated with this game event
      Returns:
      an object of the Team class
    • setTeam

      public void setTeam(Team team)
      Setter to alter which team that is associated with this game event
      Parameters:
      team - is a team
    • toString

      public String toString()
      Returns a string representation of a GameEvent object
      Overrides:
      toString in class Object
      Returns:
      a string representing an object of the class GameEvent.