summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2018-09-27 15:40:30 +0200
committernsensfel <SpamShield0@noot-noot.org>2018-09-27 15:40:30 +0200
commit2f22e667fbea56884d74ed27777f2e9f3fc9fd53 (patch)
tree75300c58cc7b287993887f84b2d68b9d515a9ec0 /src/Struct/Model.elm
parent486ee1dbe21be962e89f421e1dd5f3cbb2fd2177 (diff)
Starting to separate background and popup code.
Diffstat (limited to 'src/Struct/Model.elm')
-rw-r--r--src/Struct/Model.elm66
1 files changed, 0 insertions, 66 deletions
diff --git a/src/Struct/Model.elm b/src/Struct/Model.elm
deleted file mode 100644
index 6742e96..0000000
--- a/src/Struct/Model.elm
+++ /dev/null
@@ -1,66 +0,0 @@
-module Struct.Model exposing
- (
- Type,
- new,
- invalidate,
- reset,
- clear_error
- )
-
--- Elm -------------------------------------------------------------------------
-import Array
-
--- Extension -------------------------------------------------------------------
-import Struct.Flags
-import Struct.Error
-import Struct.Player
-
---------------------------------------------------------------------------------
--- TYPES -----------------------------------------------------------------------
---------------------------------------------------------------------------------
-type alias Type =
- {
- flags: Struct.Flags.Type,
- error: (Maybe Struct.Error.Type),
- players: (Array.Array Struct.Player.Type),
- query_index: Int,
- notify: Bool
- }
-
---------------------------------------------------------------------------------
--- LOCAL -----------------------------------------------------------------------
---------------------------------------------------------------------------------
-
---------------------------------------------------------------------------------
--- EXPORTED --------------------------------------------------------------------
---------------------------------------------------------------------------------
-new : Struct.Flags.Type -> Type
-new flags =
- {
- flags = flags,
- error = Nothing,
- players =
- (Array.push
- (Struct.Player.default)
- (Array.fromList (Struct.Flags.get_players flags))
- ),
- query_index = -1,
- notify = False
- }
-
-reset : Type -> Type
-reset model =
- {model |
- error = Nothing,
- notify = False,
- query_index = -1
- }
-
-invalidate : Struct.Error.Type -> Type -> Type
-invalidate err model =
- {model |
- error = (Just err)
- }
-
-clear_error : Type -> Type
-clear_error model = {model | error = Nothing}