Commit 730dec44 authored by Mart Lubbers's avatar Mart Lubbers

Merge branch '210-updview-member-of-svgeditor-is-not-used-propose-to-delete' into 'master'

Resolve ".updView member of SVGEditor is not used, propose to delete"

Closes #210

See merge request !207
parents 4986de0c 87c64ea4
Pipeline #16872 passed with stage
in 3 minutes and 45 seconds
......@@ -83,7 +83,6 @@ actorWithInstructions user
editor = fromSVGEditor
{ initView = \((ms2d, _), cl) -> (ms2d, cl)
, renderImage = \((_, network), _) (ms2d`, cl`) -> maps2DImage 'DS'.newSet cl` PickRoomMode ms2d` 'DM'.newMap 'DM'.newMap 'DM'.newMap 'DM'.newMap 'DM'.newMap 'DM'.newMap 'DIS'.newMap {network & devices = 'DM'.newMap}
, updView = \((ms2d, _), cl) _ -> (ms2d, cl)
, updModel = \((_, network), _) (ms2d`, cl`) -> ((ms2d`, network), cl`)
}
......@@ -411,6 +410,5 @@ mkSection
editor = fromSVGEditor
{ initView = const ([], NoAction)
, renderImage = \(((((((((mc3d, network), allDevices), statusMap), sectionUsersMap), userActorMap), invMap), exitLocks), hopLocks), ms2d) _ _ -> map2DImage 'DS'.newSet NoAction WalkAroundMode exitLocks hopLocks invMap statusMap sectionUsersMap userActorMap allDevices network (getFloorIdx mc3d, ms2d !! getFloorIdx mc3d)
, updView = \m v -> v
, updModel = \m v -> m
}
......@@ -200,7 +200,6 @@ where
, renderImage = \((_, act), ((inventoryMap, network), allDevices)) (ms2d, _) _ ->
//TODO above [] [] [margin (px 5.0, px zero) (editLayoutImage act allDevices network inventoryMap idx m2d) \\ m2d <- ms2d & idx <- [0..]] NoHost
above [] [] Nothing [] [margin (px 5.0, px zero) (editLayoutImage act allDevices network inventoryMap idx m2d) \\ m2d <- ms2d & idx <- [0..]] NoHost
, updView = \m v -> fst m
, updModel = \(_,data) newClSt -> (newClSt,data)
}
......
......@@ -437,7 +437,6 @@ where
{ initView = \((((((((((_, ms2d), _), _), _), _), _), _), _), _), cl) -> (ms2d, cl)
, renderImage = \((((((((((disSects, _), exitLocks), hopLocks), inventoryMap), statusMap), sectionUsersMap), userActorMap), network), allDevices), cl) (ms2d`, cl`)
-> maps2DImage disSects cl mode ms2d` exitLocks hopLocks inventoryMap statusMap sectionUsersMap userActorMap allDevices network
, updView = \((((((((((_, ms2d), _), _), _), _), _), _), _), _), cl) _ -> (ms2d, cl)
, updModel = \((((((((((disSects, _), exitLocks), hopLocks), inventoryMap), statusMap), sectionUsersMap), userActorMap), network), allDevices), _) (ms2d`, cl`) -> ((((((((((disSects, ms2d`), exitLocks), hopLocks), inventoryMap), statusMap), sectionUsersMap), userActorMap), network), allDevices), cl`)
}
......@@ -455,7 +454,6 @@ where
{ initView = \((((((((ms2d, _), _), _), _), _), _), _), cl) -> (ms2d, cl)
, renderImage = \((((((((ms2d, exitLocks), hopLocks), inventoryMap), statusMap), actorMap), network), allDevices), cl) (ms2d`, cl`)
-> roomImage c3d exitLocks hopLocks inventoryMap statusMap actorMap allDevices network True (fromJust (getSectionFromMap c3d ms2d`)) (ms2d !! floorIdx) cl`
, updView = \((((((((ms2d, _), _), _), _), _), _), _), cl) _ -> (ms2d, cl)
, updModel = \((((((((_, exitLocks), hopLocks), inventoryMap), statusMap), actorMap), network), allDevices), _) (ms2d`, cl`)
-> ((((((((ms2d`, exitLocks), hopLocks), inventoryMap), statusMap), actorMap), network), allDevices), cl`)
}
......
......@@ -16,7 +16,6 @@ ligrettoEditor :: !Color -> UpdateOption GameSt GameSt
ligrettoEditor me = UpdateUsing id (const id) (fromSVGEditor
{ initView = id
, renderImage = const (player_perspective me)
, updView = const id
, updModel = const id
})
......@@ -24,7 +23,6 @@ accoladesEditor :: !Color -> UpdateOption GameSt GameSt
accoladesEditor me = UpdateUsing id (const id) (fromSVGEditor
{ initView = id
, renderImage = const (player_perspective me)
, updView = const id
, updModel = const id
})
......
......@@ -17,7 +17,6 @@ updateTraxEditor :: Bool -> UpdateOption TraxSt TraxSt
updateTraxEditor turn = UpdateUsing id (const id) (fromSVGEditor
{ initView = id
, renderImage = \_ -> toImage PlayMode turn
, updView = const id
, updModel = flip const
})
......@@ -25,7 +24,6 @@ viewTraxEditor :: ViewOption TraxSt
viewTraxEditor = ViewUsing id (fromSVGEditor
{ initView = id
, renderImage = \_ -> toImage ViewMode False
, updView = const id
, updModel = flip const
})
......
......@@ -24,7 +24,6 @@ Start world
[ViewUsing id (fromSVGEditor
{ initView = id
, renderImage = const basic_images
, updView = \m _ = m
, updModel = \_ v = v
})] 0) world
......
......@@ -19,7 +19,6 @@ Start world
[ViewUsing id (fromSVGEditor
{ initView = id
, renderImage = const box2
, updView = \m _ = m
, updModel = \_ v = v
})] 0) world
......
......@@ -16,7 +16,6 @@ Start world
[ViewUsing id (fromSVGEditor
{ initView = id
, renderImage = const boxes
, updView = \m _ = m
, updModel = \_ v = v
})] 0) world
......
......@@ -23,7 +23,6 @@ Start world
[ViewUsing id (fromSVGEditor
{ initView = id
, renderImage = const clean
, updView = \m _ = m
, updModel = \_ v = v
})] 0) world
......
......@@ -21,7 +21,6 @@ Start world
[ViewUsing id (fromSVGEditor
{ initView = id
, renderImage = const grids
, updView = \m _ = m
, updModel = \_ v = v
})] 0) world
......
......@@ -24,7 +24,6 @@ Start world
[ViewUsing id (fromSVGEditor
{ initView = id
, renderImage = const linears
, updView = \m _ = m
, updModel = \_ v = v
})] 0) world
......
......@@ -14,7 +14,6 @@ Start world
[ViewUsing id (fromSVGEditor
{ initView = id
, renderImage = const image
, updView = \m _ = m
, updModel = \_ v = v
})] 0) world
......
......@@ -23,7 +23,6 @@ Start world
[UpdateUsing id (\_ v = v) (fromSVGEditor
{ initView = id
, renderImage = const count
, updView = \m _ = m
, updModel = \_ v = v
})] 0) world
......
......@@ -21,7 +21,6 @@ Start world
[ViewUsing id (fromSVGEditor
{ initView = id
, renderImage = const overlays
, updView = \m _ = m
, updModel = \_ v = v
})] 0) world
......
......@@ -18,7 +18,6 @@ Start world
[ViewUsing id (fromSVGEditor
{ initView = id
, renderImage = const polyline_in_host
, updView = \m _ = m
, updModel = \_ v = v
})] 0) world
......
......@@ -22,7 +22,6 @@ Start world
[ViewUsing id (fromSVGEditor
{ initView = id
, renderImage = const roses
, updView = \m _ = m
, updModel = \_ v = v
})] 0) world
......
......@@ -16,7 +16,6 @@ Start world
[ViewUsing id (fromSVGEditor
{ initView = id
, renderImage = const rotates
, updView = \m _ = m
, updModel = \_ v = v
})] 0) world
......
......@@ -21,7 +21,6 @@ Start world
[ViewUsing id (fromSVGEditor
{ initView = id
, renderImage = const transformed_images
, updView = \m _ = m
, updModel = \_ v = v
})] 0) world
......
......@@ -169,7 +169,6 @@ showBlueprintInstance rs bpi selDetail enabledSteps compact depth
editor outputs` = fromSVGEditor
{ initView = id
, renderImage = \_ -> mkTaskInstanceImage rs bpi outputs` enabledSteps selDetail compact
, updView = \_ x -> x
, updModel = \x _ -> x
}
......@@ -187,7 +186,6 @@ showStaticBlueprint rs bpref task compact depth
editor = fromSVGEditor
{ initView = id
, renderImage = \_ -> mkStaticImage rs bpref compact
, updView = \_ x -> x
, updModel = \x _ -> x
}
......
......@@ -8,7 +8,6 @@ import iTasks.UI.JS.Encoding
:: SVGEditor m v =
{ initView :: m -> v // Initialize a 'view' value that holds temporary data while editing
, renderImage :: m v *TagSource -> Image` v // Render an interactive image that
, updView :: m v -> v // When the model is externally updated, the view needs to be updated too
, updModel :: m v -> m // When the view is updated (using the image), the change needs to be merged back into the view
}
......
......@@ -13,7 +13,7 @@ import iTasks.Extensions.SVG.SVGEditor
testSVGEditlet = updateInformation "SVG image" [UpdateUsing id (const id) (fromSVGEditor svgeditor)] 42
where
svgeditor = {SVGEditor|initView=const (),renderImage = \_ _ _ -> nederland, updView = \m v -> v, updModel = \m v -> m}
svgeditor = {SVGEditor|initView=const (),renderImage = \_ _ _ -> nederland, updModel = \m v -> m}
nederland :: Image m
nederland = banden (H *. 3 /. 2,H) [toSVGColor {r=174,g=28,b=40},toSVGColor "white",toSVGColor {r=33,g=70,b=139}]
......
......@@ -14,7 +14,7 @@ testSVGEditletClick
= updateInformation "SVG Clicks" [UpdateUsing (\m -> m) (\m v -> v) (fromSVGEditor svgeditor)] "No clicks"
>&> \s -> viewSharedInformation "DEBUG" [] s
where
svgeditor = {SVGEditor|initView=id,renderImage = renderImage, updView = \m v -> m, updModel = \m v -> v}
svgeditor = {SVGEditor|initView=id,renderImage = renderImage, updModel = \m v -> v}
renderImage :: String String *TagSource -> Image String
renderImage str _ _
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment