Library to manage football scoreboard
- Start of a new
Match
assumes- Initial score of 0 – 0 [
HOME
-AWAY
] Match
is added to theScoreboard
- Initial score of 0 – 0 [
Update
score- Receives a pair of absolute scores,
HOME
team score andAWAY
team score
- Receives a pair of absolute scores,
Finish
match- Applies only to currently in-progress
Match
- Removes a
Match
from theScoreboard
- Applies only to currently in-progress
- Get
Summary
ofMatches
in-progress- Shows results ordered by their TOTAL score
Matches
with the same TOTAL score will be returned ordered by the most recently startedMatch
in theScoreboard
- Solution is managed using an instance of
ScoreboardManager
ScoreboardManager
can be instantiated using thegetInstance()
static
method. This is due to the fact thatScoreboardManager
is asingleton class
ScoreboardManager
has the following methods for managing the lifecycle of the Matches and ScoreboardstartNewMatch
- Parameters: Two strings representing names of the
HOME
andAWAY
teams respectively - Returns:
UUID
representing the newly startedMatch
Id
- Parameters: Two strings representing names of the
updateScore
- Parameters:
UUID
representing theMatch
Id, and theTeamType
representing anEnum
forHOME
andAWAY
teams - Returns: A
Map
with keys representing anEnum
forHOME
andAWAY
teams, while values representingScores
respectively
- Parameters:
endMatch
- Parameters:
UUID
representing theMatch
Id - Returns:
Void
- Parameters:
summary
- Parameters:
N.A
- Returns: A
List
of allMatches
in-progress
- Parameters: