aboutsummaryrefslogtreecommitdiff
path: root/src/Model/Round.elm
diff options
context:
space:
mode:
Diffstat (limited to 'src/Model/Round.elm')
-rw-r--r--src/Model/Round.elm19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Model/Round.elm b/src/Model/Round.elm
new file mode 100644
index 0000000..d5210d5
--- /dev/null
+++ b/src/Model/Round.elm
@@ -0,0 +1,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