From 2abb8ffa46cbe86deedb9ddcbb9b042b51285feb Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Sun, 22 Mar 2015 12:53:55 +0100 Subject: Editing name first draft --- src/Model/Edition/Edition.elm | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/Model/Edition/Edition.elm (limited to 'src/Model/Edition/Edition.elm') diff --git a/src/Model/Edition/Edition.elm b/src/Model/Edition/Edition.elm new file mode 100644 index 0000000..89a0b52 --- /dev/null +++ b/src/Model/Edition/Edition.elm @@ -0,0 +1,34 @@ +module Model.Edition.Edition + ( Edition + , Kind(..) + , newEdition + , keyCodeToChar + ) where + +import Keyboard (KeyCode) + +import Model.Id (..) +import Model.Edition.NameEdition as NameEdition +import Model.Edition.TimeEdition as TimeEdition + +type alias Edition = + { id : Id + , kind : Kind + , chars : List Char + } + +type Kind = + Name + | Time + +newEdition id kind = + { id = id + , kind = kind + , chars = [] + } + +keyCodeToChar : Kind -> KeyCode -> Maybe Char +keyCodeToChar kind = + case kind of + Name -> NameEdition.keyCodeToChar + Time -> TimeEdition.keyCodeToChar -- cgit v1.2.3