Skip to content

Commit

Permalink
Store ratings in list
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonkearns committed Jan 29, 2017
1 parent c029feb commit 5133cea
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/setup/Main.elm
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ type Msg
| SetGoal
| ChangeGoal
| UpdateGoalInput String
| EnterRating Int
| Quit
| ComboMsg Keyboard.Combo.Msg

Expand All @@ -47,6 +48,9 @@ keyboardCombos : List (Keyboard.Combo.KeyCombo Msg)
keyboardCombos =
[ Keyboard.Combo.combo2 ( Keyboard.Combo.control, Keyboard.Combo.enter ) StartTimer
, Keyboard.Combo.combo2 ( Keyboard.Combo.command, Keyboard.Combo.enter ) StartTimer
, Keyboard.Combo.combo2 ( Keyboard.Combo.shift, Keyboard.Combo.one ) (EnterRating 1)
, Keyboard.Combo.combo2 ( Keyboard.Combo.shift, Keyboard.Combo.two ) (EnterRating 2)
, Keyboard.Combo.combo2 ( Keyboard.Combo.shift, Keyboard.Combo.three ) (EnterRating 3)
]


Expand All @@ -64,6 +68,7 @@ type alias Model =
, tip : Tip.Tip Msg
, goal : Maybe String
, newGoal : String
, ratings : List Int
}


Expand All @@ -82,6 +87,7 @@ initialModel =
, tip = Tip.emptyTip
, goal = Nothing
, newGoal = ""
, ratings = []
}


Expand Down Expand Up @@ -441,6 +447,9 @@ update msg model =
ChangeGoal ->
{ model | goal = Nothing } ! []

EnterRating rating ->
{ model | ratings = model.ratings ++ [ rating ] } ! []


addMobster : String -> Model -> Model
addMobster newMobster model =
Expand Down

0 comments on commit 5133cea

Please sign in to comment.