2022-02-23 12:12:43 +01:00
|
|
|
@startuml Tournament System
|
|
|
|
|
2022-03-01 23:59:58 +01:00
|
|
|
|
|
|
|
' class Group
|
|
|
|
|
|
|
|
' Match med bare to teams:
|
|
|
|
' class Match {
|
|
|
|
' *match_id: Integer
|
|
|
|
' tournament_id: Integer
|
|
|
|
' team1_id: Integer
|
|
|
|
' team2_id: Integer
|
|
|
|
' scores: [Integer, Integer]
|
|
|
|
' winner_id: Integer
|
|
|
|
' void setScore(team1_score: Integer, team2_score: Integer)
|
|
|
|
' void setWinner(winner_id: Integer)
|
|
|
|
' Integer getWinner()
|
|
|
|
' }
|
|
|
|
|
|
|
|
' Match med vilkårlig antall teams
|
2022-02-23 12:12:43 +01:00
|
|
|
class Match {
|
2022-03-01 23:59:58 +01:00
|
|
|
*match_id: Integer
|
|
|
|
tournament_id: Integer
|
|
|
|
team_ids: Integer[]
|
|
|
|
scores: Integer[]
|
2022-02-23 12:12:43 +01:00
|
|
|
winner_id: Integer
|
2022-03-01 23:59:58 +01:00
|
|
|
|
|
|
|
Match constructor(tournament_id: Integer, team_ids: Integer[])
|
|
|
|
void setScore(team_id: Integer, score: Integer)
|
2022-02-23 12:12:43 +01:00
|
|
|
void setWinner(winner_id: Integer)
|
2022-03-01 23:59:58 +01:00
|
|
|
Integer getWinner()
|
2022-02-23 12:12:43 +01:00
|
|
|
}
|
2022-03-01 23:59:58 +01:00
|
|
|
class Team {
|
|
|
|
*team_id: Integer
|
|
|
|
name: String
|
|
|
|
tournament_ids: Integer[]
|
|
|
|
player_ids: Integer[]
|
|
|
|
match_ids: Integer[]
|
2022-02-23 12:12:43 +01:00
|
|
|
|
2022-03-01 23:59:58 +01:00
|
|
|
Team constructor(name: String)
|
|
|
|
void joinTournament(tournament_id: Integer)
|
|
|
|
void addPlayer(player_id: Integer)
|
|
|
|
void addMatch(match_id: Integer)
|
|
|
|
void removePlayer(player_id: Integer)
|
|
|
|
void removeMatch(match_id: Integer)
|
|
|
|
void leaveTournament(tournament_id: Integer)
|
|
|
|
}
|
2022-02-23 12:12:43 +01:00
|
|
|
class Player {
|
2022-03-01 23:59:58 +01:00
|
|
|
*player_id: Integer
|
2022-02-23 12:12:43 +01:00
|
|
|
name: String
|
2022-03-01 23:59:58 +01:00
|
|
|
team_id: Integer
|
|
|
|
|
|
|
|
|
|
|
|
Player constructor(name: String)
|
|
|
|
void joinTeam(team_id: Integer)
|
|
|
|
void leaveTeam()
|
2022-02-23 12:12:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
class Tournament {
|
2022-03-01 23:59:58 +01:00
|
|
|
*tournament_id: Integer
|
|
|
|
name: String
|
|
|
|
start_date: Date
|
|
|
|
end_date: Date
|
|
|
|
team_ids: Integer[]
|
|
|
|
|
|
|
|
Tournament constructor(name: String, start_date: Date, end_date: Date)
|
|
|
|
void addTeam(team_id: Integer)
|
|
|
|
void removeTeam(team_id: Integer)
|
2022-02-23 12:12:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Tournament "1" *-- "2..*" Team : contains
|
2022-03-01 23:59:58 +01:00
|
|
|
Tournament "1" *-- "*" Match : contains
|
2022-02-23 12:12:43 +01:00
|
|
|
Player "1..*" *-- "1" Team : belongsTo
|
|
|
|
Match "*" *--- "2" Team : contains
|
|
|
|
|
|
|
|
|
|
|
|
@enduml
|