This commit is contained in:
2022-07-02 16:57:42 +01:00
parent e0222dd72b
commit dc3b78f8c4
3 changed files with 3 additions and 7 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ maybeClearPath :: World -> (Int,Int,PathEdge) -> World
maybeClearPath w (x,y,pe)
| runIdentity . S.any_ (const True) $ overlapSegWalls (_peStart pe) (_peEnd pe) $ wlsNearSeg (_peStart pe) (_peEnd pe) w
= w
| otherwise = w & pathGraph %~ (FGL.insEdge (x,y,pe & peObstacles .~ mempty)) . FGL.delEdge (x,y)
| otherwise = w & pathGraph %~ FGL.insEdge (x,y,pe & peObstacles .~ mempty) . FGL.delEdge (x,y)
destroyDoor :: Door -> World -> World
destroyDoor dr w = w
+1 -5
View File
@@ -36,10 +36,6 @@ makePathBetween a b w = do -- join $ sp <$> a' <*> b' <*> return (_pathGraph w)
na <- walkableNodeNear w a
nb <- walkableNodeNear w b
sp na nb (second _peDist (_pathGraph w))
where
--nodesNear p = concat $ lookLookups (zoneNearPointIP p) (_pathPoints w)
-- nodesNear p = runIdentity . S.toList_ $ nearPoint _pnZoning p w
-- walkableNodeNear p = fmap fst . find (flip (isWalkable p) w . snd) $ nodesNear p
walkableNodeNear :: World -> Point2 -> Maybe Int
{-# INLINE walkableNodeNear #-}
@@ -132,7 +128,7 @@ obstructPathsCrossing sp ep w =
edgecrosses (_,_,pe) = isJust $ intersectSegSeg sp ep (_peStart pe) (_peEnd pe)
updateedges gr = runIdentity $ S.fold_ updateedge gr id edges
updateedge gr (x,y,pe)
= insEdge (x,y,pe & peObstacles . at BlockObstacle .~ Just ()) $ delEdge (x,y) gr
= insEdge (x,y,pe & peObstacles . at BlockObstacle ?~ ()) $ delEdge (x,y) gr
removePathsCrossing :: Point2 -> Point2 -> World -> World
removePathsCrossing a b w = w
+1 -1
View File
@@ -68,7 +68,7 @@ plLineBlock basePane blwidth a b gw = ( 0
blid = IM.newKey $ _blocks gw
insertBlock (i,p) =
insertWalls (i + blid) (makeWallAt p i)
. (over blocks $ IM.insert (i+blid) Block
. over blocks (IM.insert (i+blid) Block
{ _blID = i + blid, _blWallIDs = IS.fromList $ ksAtI i
, _blHP = 1000, _blShadows = shadowsAt i
, _blDir = 0 -- THIS IS NOT SENSIBLE. TODO rethink block positioning