@startuml
class Competition
class Winner {
  athlete : Athlete
}

' Members

class Member
class Athlete {
  age : Integer
  corporalWeight: Float
}
class Male
class Female
class Judge
class CompetitionSecretary

' Competition phases

class Phase {
  next : Phase
}
class Weighing
class Development
class Classification

class Batch
class MaleBatch
class FemaleBatch
class Iteration

class Mode
class Snatch
class CleanAndJerk

class Step {
  next : Step
}
class AthletesAnnouncement {
  first : Athlete
  next : Athlete
}
class Lift {
  athlete : Athlete
  weight : Integer
}
class ValidLift
class NullLift

class Countdown {
  duration : Integer
}
class "60 sec" as SimpleCountdown
class "120 sec" as DoubleCountdown


' Bars and plates

class Bar {
  weight : Integer
  length : Integer
}
class MaleBar
class FemaleBar

class Plate {
  color : String
  weight : Float
}

class BlackOrWhite
class Green
class Yellow
class Blue
class Red

' Categories and parameters

class Category {
  minAge : Integer
  maxAge : Integer
  minWeight : Float
  maxWeight : Float
}

class AthleteAge

class Weight {
  athlete : Athlete
}
class BodyWeight
class Opener
class OlympicTotal

' Scoring

class ScoringMode
class ByCategoriesMode
class AllAgainstAllMode

class ScoringCalculation
class ByOlympicTotalCalculation
class SinclairCoefficientCalculation

'''''

Competition "1" *--> "3" Phase
Competition "n" o--> "n" Member
Member <|-- Athlete
Athlete <|-- Male
Athlete <|-- Female
Athlete "1" --> "n" Lift
Athlete "n" --> "1" Category
Athlete "1" --> "1" Weight
Member <|-- Judge
Member <|-- CompetitionSecretary
Phase <|-- Weighing
Phase <|-- Development
Phase <|-- Classification
Weighing --> Development
Development --> Classification
Classification "1" o--> "n" OlympicTotal
Weighing "1" o--> "n" Weight
Weight <|-- BodyWeight
Weight <|-- Opener
Development "1" *--> "n" Batch
Batch <|-- MaleBatch
Batch <|-- FemaleBatch
Male "n" --> "1" MaleBatch
Female "n" --> "1" FemaleBatch
Batch "1" *--> "n" Iteration
Iteration "1" *--> "2" Step
Step <|-- AthletesAnnouncement
Step <|-- Lift
Lift <|-- NullLift
Lift <|-- ValidLift
ValidLift "n" --> "1" OlympicTotal
Lift --> Countdown
Countdown <|-- SimpleCountdown
Countdown <|-- DoubleCountdown
AthletesAnnouncement --> Lift
Mode <|-- Snatch
Mode <|-- CleanAndJerk
Iteration "1" --> "1" Mode
Category ..> BodyWeight
Category ..> AthleteAge
Bar <|-- MaleBar
Bar <|-- FemaleBar
Bar "1" o--> "2..2n" Plate
MaleBatch "n" ..> "1" MaleBar
FemaleBatch "n" ..> "1" FemaleBar
Lift "n" --> "1" Bar
Lift "m" --> "n" Plate

Plate <|-- BlackOrWhite
Plate <|-- Green
Plate <|-- Yellow
Plate <|-- Blue
Plate <|-- Red

Competition --> "1" ScoringMode
ScoringMode <|-- ByCategoriesMode
ScoringMode <|-- AllAgainstAllMode

ScoringCalculation <|-- ByOlympicTotalCalculation
ScoringCalculation <|-- SinclairCoefficientCalculation

ByOlympicTotalCalculation ..> OlympicTotal
SinclairCoefficientCalculation ..> AthleteAge
SinclairCoefficientCalculation ..> OlympicTotal

ScoringMode --> ScoringCalculation
ByCategoriesMode --> ByOlympicTotalCalculation
AllAgainstAllMode --> SinclairCoefficientCalculation

ByCategoriesMode o--> "n" Category

Athlete "n" --> "1" Winner
Competition o--> "n" Winner
Winner ..> ScoringCalculation
@enduml
