Skip to content

Instantly share code, notes, and snippets.

@vladbatushkov
Last active November 28, 2020 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vladbatushkov/1785eea9dbbfabbc3409f63e29f1eb64 to your computer and use it in GitHub Desktop.
Save vladbatushkov/1785eea9dbbfabbc3409f63e29f1eb64 to your computer and use it in GitHub Desktop.
eatnoteat update
type Msg
= Idle
| Eat (List Tags)
| Damage Int
| HpCheck Int
| ChangeHero Hero
| ShuffleFood
| Shuffle (List Food)
| Animate AnimatedObject Animation.Msg
update : Msg -> Model -> ( Model, Cmd Msg )
update action model =
case action of
Idle ->
( model, Cmd.none )
Eat tags ->
...
Damage points ->
...
HpCheck points ->
...
ChangeHero hero ->
( { model | hero = hero, screen = PlayScreen }, Cmd.none )
ShuffleFood ->
( model, generate Shuffle <| shuffle model.foodPanel.foods )
Shuffle randomFoods ->
...
Animate aObj aMsg ->
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment