Class Substitution
java.lang.Object
edu.ntnu.idatt1002.k01g08.fta.objects.events.GameEvent
edu.ntnu.idatt1002.k01g08.fta.objects.events.Substitution
Class representing a specific type of GameEvent called Substitution
The Substitution holds information on when during a match that the action has happened
in a form of a String timeStampOfMatchTime. It also stores information about the team exercising
the substitution, and which players that switch playing in the match
The class has two constructors
The first takes parameters for all attributes
and understands which team that is making a substitution based on the players switched
-
Constructor Summary
ConstructorsConstructorDescriptionSubstitution
(String timeStampOfMatchTime, Team teamSwitchingPlayers, Player playerIn, Player playerOut) First constructor for a Substitution which requires all parameters under to instantiate a new Substitution -
Method Summary
Modifier and TypeMethodDescriptiongetEvent()
GetEvent method to get a string description of the eventAccessor method to get the player that is substituted in this SubstitutionAccessor method to get the player that is subbed out in this Substitutionvoid
setPlayerIn
(Player playerIn) Mutator method to alter the player that is substituted in this Substitutionvoid
setPlayerOut
(Player playerOut) Mutator method to alter the player that is switched out in this SubstitutiontoString()
Returns a string representation of a GameEvent objectMethods inherited from class edu.ntnu.idatt1002.k01g08.fta.objects.events.GameEvent
getPlayer, getTeam, getTimeStampOfMatchTime, setPlayer, setTeam, setTimeStampOfMatchTime
-
Constructor Details
-
Substitution
public Substitution(String timeStampOfMatchTime, Team teamSwitchingPlayers, Player playerIn, Player playerOut) throws IllegalArgumentException First constructor for a Substitution which requires all parameters under to instantiate a new Substitution- Parameters:
timeStampOfMatchTime
- , is a String which cannot have value zero or be a blank stringteamSwitchingPlayers
- , is of class Team and is the team making the substitutionplayerIn
- , is of class Player and is the player being subbed inplayerOut
- , is of class Player and is the player being subbed out- Throws:
IllegalArgumentException
- if the parameter timeStampOfMatchTime is either of null-value or is a blank string
-
-
Method Details
-
getPlayerIn
Accessor method to get the player that is substituted in this Substitution- Returns:
- Player playerIn
-
setPlayerIn
Mutator method to alter the player that is substituted in this Substitution- Parameters:
playerIn
- is the player being subbed on
-
getPlayerOut
Accessor method to get the player that is subbed out in this Substitution- Returns:
- Player playerOut
-
setPlayerOut
Mutator method to alter the player that is switched out in this Substitution- Parameters:
playerOut
- is the player being subbed out
-
getEvent
GetEvent method to get a string description of the event -
toString
Description copied from class:GameEvent
Returns a string representation of a GameEvent object
-