Skip to content
Snippets Groups Projects
Commit 38f60429 authored by Oskar Marquardt's avatar Oskar Marquardt
Browse files

Added Spheres to Character

parent 080a19df
No related branches found
No related tags found
No related merge requests found
Pipeline #22111 passed
......@@ -2,10 +2,17 @@ module Character exposing (..)
type alias Character =
{ name : String
, spheres : Spheres
}
type CharacterField
= Name
type alias Spheres =
{ correspondence : Sphere
}
type alias Sphere =
{ name : String
, dots : Int
}
changeName : Character -> String -> Character
changeName character newName =
......@@ -18,4 +25,10 @@ changeName character newName =
new : Character
new =
{ name = "Default Name"
, spheres =
{ correspondence =
{ name = "Correspondence"
, dots = 0
}
}
}
\ No newline at end of file
......@@ -4,7 +4,7 @@ import Browser
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import Character exposing (..)
import Character exposing (Character)
main : Program () Model Msg
main =
......@@ -17,7 +17,7 @@ main =
init : () -> ( Model, Cmd Msg )
init _ =
( { character = new
( { character = Character.new
, modal = Nothing
, modalValue = ""
}
......@@ -61,7 +61,7 @@ update msg model =
case modalType of
Name ->
( { model
| character = changeName model.character model.modalValue
| character = Character.changeName model.character model.modalValue
, modal = Nothing
}
, Cmd.none
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment