2022-03-02 10:26:23 +01:00
|
|
|
@startuml Tournament System
|
|
|
|
' Internal development class diagram
|
|
|
|
' Describes database fields and object methods required
|
2022-03-15 14:55:31 +01:00
|
|
|
title Tournament System - Group 1
|
2022-03-02 10:26:23 +01:00
|
|
|
|
|
|
|
class Match {
|
|
|
|
*match_id: Integer
|
|
|
|
tournament_id: Integer
|
|
|
|
team_ids: Integer[]
|
|
|
|
winner_id: Integer
|
2022-03-15 14:55:31 +01:00
|
|
|
tier: Integer
|
2022-03-02 10:26:23 +01:00
|
|
|
|
|
|
|
Match constructor(tournament_id: Integer, team_ids: Integer[])
|
|
|
|
void setWinner(winner_id: Integer)
|
|
|
|
}
|
|
|
|
class Team {
|
|
|
|
*team_id: Integer
|
|
|
|
name: String
|
|
|
|
tournament_ids: Integer[]
|
|
|
|
|
|
|
|
Team constructor(name: String)
|
|
|
|
void joinTournament(tournament_id: Integer)
|
|
|
|
void addPlayer(player_id: Integer)
|
|
|
|
void removePlayer(player_id: Integer)
|
|
|
|
void leaveTournament(tournament_id: Integer)
|
|
|
|
}
|
|
|
|
class Player {
|
|
|
|
*player_id: Integer
|
|
|
|
name: String
|
|
|
|
team_id: Integer
|
|
|
|
|
|
|
|
|
|
|
|
Player constructor(name: String)
|
|
|
|
void joinTeam(team_id: Integer)
|
|
|
|
void leaveTeam()
|
|
|
|
}
|
|
|
|
|
|
|
|
class Tournament {
|
|
|
|
*tournament_id: Integer
|
|
|
|
name: String
|
|
|
|
start_date: Date
|
|
|
|
end_date: Date
|
2022-03-14 22:21:27 +01:00
|
|
|
manager_ids: Integer[]
|
2022-03-02 10:26:23 +01:00
|
|
|
team_ids: Integer[]
|
|
|
|
|
|
|
|
Tournament constructor(name: String, start_date: Date, end_date: Date)
|
|
|
|
void addTeam(team_id: Integer)
|
|
|
|
void removeTeam(team_id: Integer)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-03-14 22:21:27 +01:00
|
|
|
Team "2..*" -- "1..*" Tournament : "Plays in"
|
|
|
|
Tournament "1" -- "1..*" Match : contains
|
|
|
|
Player "1..*" -- "1..1" Team : "Belongs to"
|
|
|
|
Team "2..2" -- "1..*" Match : "Competes in"
|
2022-03-02 10:26:23 +01:00
|
|
|
|
|
|
|
|
|
|
|
@enduml
|