Cleanup
This commit is contained in:
@@ -165,7 +165,7 @@ placeChasm gw rid ps shiftps =
|
||||
& gwWorld %~ f
|
||||
where
|
||||
f w = foldl' g w (loopPairs shiftps)
|
||||
g w (x, y) = fst $ obstructPathsCrossing (S.singleton ChasmObstacle) x y w
|
||||
g w (x, y) = obstructPathsCrossing (S.singleton ChasmObstacle) x y w
|
||||
|
||||
--evaluateRandPS
|
||||
-- :: Int -> State StdGen PSType -> PlacementSpot -> GenWorld -> (Int, GenWorld)
|
||||
@@ -185,7 +185,7 @@ placeWallPoly qs wl w = foldl' (addPane wl) w pairs
|
||||
addPane :: Wall -> World -> (Point2, Point2) -> World
|
||||
addPane wl w l =
|
||||
w & plNew (cWorld . lWorld . walls) wlID (wl & wlLine .~ l)
|
||||
& fst . uncurry (obstructPathsCrossing (S.fromList [WallObstacle WallNotAutoOpen])) l
|
||||
& uncurry (obstructPathsCrossing (S.fromList [WallObstacle WallNotAutoOpen])) l
|
||||
|
||||
mvProp :: Point2 -> Float -> Prop -> Prop
|
||||
mvProp p a = (prRot +~ a) . (prPos %~ ((p +.+) . rotateV a))
|
||||
|
||||
@@ -86,7 +86,6 @@ plLineBlock basePane blwidth a b gw =
|
||||
, _blShadows = shadowsAt i
|
||||
, _blDir = 0 -- THIS IS NOT SENSIBLE. TODO rethink block positioning
|
||||
, _blFootprint = cornersAt p -- TODO check winding (clockwise, anticlockwise)
|
||||
, _blObstructs = mempty
|
||||
, _blMaterial = _wlMaterial basePane
|
||||
, _blHeight = 100
|
||||
, _blPos = p
|
||||
@@ -114,11 +113,9 @@ plLineBlock basePane blwidth a b gw =
|
||||
|
||||
-- | Must be done after inserting the block
|
||||
insertWalls :: Int -> [Wall] -> World -> World
|
||||
insertWalls blid wls w = w' & cWorld . lWorld . blocks . ix blid . blObstructs .~ concat paths
|
||||
where
|
||||
(w', paths) = mapAccumR (flip insertWall) w wls
|
||||
insertWalls _ wls w = foldl' (flip insertWall) w wls
|
||||
|
||||
insertWall :: Wall -> World -> (World, [(Int,Int)])
|
||||
insertWall :: Wall -> World -> World
|
||||
insertWall wl =
|
||||
uncurry (obstructPathsCrossing (S.fromList [WallObstacle WallNotAutoOpen, WallObstacle WallBlockVisibility]))
|
||||
(_wlLine wl)
|
||||
|
||||
@@ -61,7 +61,7 @@ addDoorWall eo drid wl w (wlid, wlps) =
|
||||
}
|
||||
-- & cWorld . lWorld . doors . ix drid . drObstructs <>~ es
|
||||
where
|
||||
(w', _) = uncurry (obstructPathsCrossing eo) wlps w
|
||||
w' = uncurry (obstructPathsCrossing eo) wlps w
|
||||
|
||||
updateDoorEdges :: EdgeObstacle -> [(Int,Int)] -> World -> World
|
||||
updateDoorEdges eo es w = foldl' (updateDoorEdge eo) w es
|
||||
|
||||
Reference in New Issue
Block a user