-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMapNode.elm
47 lines (39 loc) · 826 Bytes
/
MapNode.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
module MapNode exposing (..)
import Html exposing (..)
import Html.Events exposing (..)
import Connectors exposing (..)
type alias MapNode = {
id : Int
,displayText : String
,px : Int
,py : Int
,connectors : List Connector
,sideRegions : List SideRegion
}
type SideState = Normal | Hover
type alias SideRegion = {
state : SideState
,side : Side
}
getInit : Int -> MapNode
getInit identifier =
{
id = identifier
,displayText = "NewNode"
,px = 50
,py = 50
,connectors = []
,sideRegions = [
{state = Normal, side = Top}
,{state = Normal, side = Left}
,{state = Normal, side = Right}
,{state = Normal, side = Bottom} ]
}
type alias UIPanelData = {
node : MapNode
}
getPanelInit : Int -> UIPanelData
getPanelInit id =
{
node = getInit id
}