aboutsummaryrefslogtreecommitdiff
path: root/src/Model/Round.elm
blob: d5210d51be6f1e3d15e500bf805764db820cf012 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module Model.Round
  ( Round
  , roundOrder
  ) where

import Time (Time)

type alias Round =
  { duration : Time
  , score : Int
  }

roundOrder : Round -> Round -> Order
roundOrder round1 round2 =
  if round1.score == round2.score
    then
      compare round2.duration round1.duration
    else
      compare round1.score round2.score