From e008855086d124f0de14eacc858ecb57d23e371c Mon Sep 17 00:00:00 2001 From: nsensfel Date: Thu, 19 Oct 2017 13:30:40 +0200 Subject: Starting a more modular approach for the website. --- elm/battlemap/src/Model.elm | 58 --------------------------------------------- 1 file changed, 58 deletions(-) delete mode 100644 elm/battlemap/src/Model.elm (limited to 'elm/battlemap/src/Model.elm') diff --git a/elm/battlemap/src/Model.elm b/elm/battlemap/src/Model.elm deleted file mode 100644 index ed067d3..0000000 --- a/elm/battlemap/src/Model.elm +++ /dev/null @@ -1,58 +0,0 @@ -module Model exposing - ( - Type, - Selection(..), - State(..), - get_state, - invalidate, - reset, - clear_error - ) - -import Dict - -import Battlemap -import Battlemap.Location - -import Error - -import Character - -type State = - Default - | MovingCharacterWithButtons - | MovingCharacterWithClick - | FocusingTile - -type Selection = - None - | SelectedCharacter Character.Ref - | SelectedTile Battlemap.Location.Ref - -type alias Type = - { - state: State, - battlemap: Battlemap.Type, - characters: (Dict.Dict Character.Ref Character.Type), - error: (Maybe Error.Type), - selection: Selection - } - -get_state : Type -> State -get_state model = model.state - -reset : Type -> (Dict.Dict Character.Ref Character.Type) -> Type -reset model characters = - {model | - state = Default, - battlemap = (Battlemap.reset model.battlemap), - characters = characters, - error = Nothing, - selection = None - } - -invalidate : Type -> Error.Type -> Type -invalidate model err = {model | error = (Just err)} - -clear_error : Type -> Type -clear_error model = {model | error = Nothing} -- cgit v1.2.3-70-g09d2