aboutsummaryrefslogtreecommitdiff
path: root/src/Model
diff options
context:
space:
mode:
Diffstat (limited to 'src/Model')
-rw-r--r--src/Model/Model.elm3
-rw-r--r--src/Model/Position.elm12
-rw-r--r--src/Model/TimerEdition.elm16
3 files changed, 31 insertions, 0 deletions
diff --git a/src/Model/Model.elm b/src/Model/Model.elm
index 9a20219..b7ac48a 100644
--- a/src/Model/Model.elm
+++ b/src/Model/Model.elm
@@ -9,6 +9,7 @@ import Dict
import Time (Time)
import Model.Timer (..)
+import Model.TimerEdition (..)
import Model.Id (..)
import Model.IdGenerator (..)
@@ -16,6 +17,7 @@ type alias Model =
{ currentTime : Time
, timers : Dict Id Timer
, timerIdGenerator : IdGenerator
+ , timerEdition : Maybe TimerEdition
}
initialModel : Time -> Model
@@ -25,6 +27,7 @@ initialModel initialTime =
in { currentTime = initialTime
, timers = Dict.insert id (initialTimer initialTime timerName) Dict.empty
, timerIdGenerator = idGenerator
+ , timerEdition = Nothing
}
substractTimersTime : Time -> Dict Id Timer -> Dict Id Timer
diff --git a/src/Model/Position.elm b/src/Model/Position.elm
new file mode 100644
index 0000000..b73a3d9
--- /dev/null
+++ b/src/Model/Position.elm
@@ -0,0 +1,12 @@
+module Model.Position
+ ( positionEncoder
+ ) where
+
+import Json.Encode (..)
+
+positionEncoder : (Int, Int) -> Value
+positionEncoder (x, y) =
+ object
+ [ ("x", int x)
+ , ("y", int y)
+ ]
diff --git a/src/Model/TimerEdition.elm b/src/Model/TimerEdition.elm
new file mode 100644
index 0000000..c7b90c5
--- /dev/null
+++ b/src/Model/TimerEdition.elm
@@ -0,0 +1,16 @@
+module Model.TimerEdition
+ ( TimerEdition
+ , newTimerEdition
+ ) where
+
+import Model.Id (..)
+
+type alias TimerEdition =
+ { id : Id
+ , numbers : List Int
+ }
+
+newTimerEdition id =
+ { id = id
+ , numbers = []
+ }