-
Notifications
You must be signed in to change notification settings - Fork 3
/
Model.elm
55 lines (45 loc) · 1.27 KB
/
Model.elm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
module Model (ExportModel, Model, initialModel, modelToExportModel) where
import Ethos exposing (Ethos)
import Government exposing (Government, GovernmentForm)
import Trait exposing (Trait)
import Version
type alias Model =
{ version : Int
, name : String
, warning : Maybe String
, selectedEthoses : List Ethos
, hoveredEthos : Maybe Ethos
, selectedGovernment : Maybe Government
, hoveredGovernment : Maybe Government
, hoveredGovernmentForm : Maybe GovernmentForm
, selectedTraits : List Trait
, hoveredTrait : Maybe Trait
}
type alias ExportModel =
{ version : Int
, name : String
, selectedEthoses : List Ethos
, selectedGovernment : Maybe Government
, selectedTraits : List Trait
}
modelToExportModel : Model -> ExportModel
modelToExportModel model =
{ version = model.version
, name = model.name
, selectedEthoses = model.selectedEthoses
, selectedGovernment = model.selectedGovernment
, selectedTraits = model.selectedTraits
}
initialModel : Model
initialModel =
{ version = Version.get
, name = ""
, warning = Nothing
, selectedEthoses = []
, hoveredEthos = Nothing
, selectedGovernment = Nothing
, hoveredGovernment = Nothing
, hoveredGovernmentForm = Nothing
, selectedTraits = []
, hoveredTrait = Nothing
}