Improve machines, tweak wall ids

This commit is contained in:
2021-11-01 15:21:21 +00:00
parent 7692421112
commit 7ddbbdda14
11 changed files with 76 additions and 28 deletions
+2 -1
View File
@@ -25,6 +25,7 @@ import Color
import Control.Monad.State
import Control.Lens
import qualified Data.IntSet as IS
placeSpot :: World -> ((Point2,Float) , Placement) -> World
placeSpot w (shift, plmnt) =
@@ -195,7 +196,7 @@ placeMachine color wallpoly mc p rot w = (mcid
where
mcid = IM.newKey $ _machines w
wlid = IM.newKey $ _walls w
wlids = [wlid .. wlid + length wallpoly]
wlids = IS.fromList [wlid .. wlid + length wallpoly]
addMc mcs = IM.insert mcid (mc {_mcPos = p,_mcDir = rot,_mcID = mcid, _mcWallIDs = wlids}) mcs
-- TODO correctly remove/shift pathfinding lines (removePathsCrossing)
placeMachineWalls :: Color -> [Point2] -> Int -> Int -> IM.IntMap Wall -> IM.IntMap Wall