diff options
Diffstat (limited to 'src/Model')
-rw-r--r-- | src/Model/Game.elm | 5 | ||||
-rw-r--r-- | src/Model/Round.elm | 19 |
2 files changed, 22 insertions, 2 deletions
diff --git a/src/Model/Game.elm b/src/Model/Game.elm index 705841d..6a9020f 100644 --- a/src/Model/Game.elm +++ b/src/Model/Game.elm @@ -10,6 +10,7 @@ import Model.Player (..) import Model.Cloud (..) import Model.Vec2 (Vec2) import Model.Config (..) +import Model.Round (Round) type alias Game = { time : Float @@ -17,7 +18,7 @@ type alias Game = , currentScore : Int , player : Player , cloud : Cloud - , scores : List Int + , rounds : List Round , seed : Seed } @@ -28,6 +29,6 @@ initialGame seed = , currentScore = 0 , player = initPlayer , cloud = initCloud - , scores = [] + , rounds = [] , seed = seed } 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 |