This commit is contained in:
2025-10-24 18:50:09 +01:00
parent 488428b1ef
commit ccb809a090
9 changed files with 36 additions and 78 deletions
+4 -7
View File
@@ -1,5 +1,5 @@
--{-# LANGUAGE LambdaCase #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
--{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
{- | deals with placement of objects within the world
after they have had their coordinates set by the layout
@@ -174,13 +174,10 @@ placeChasm gw rid ps shiftps =
-- where
-- (evaluatedType, g) = runState rgen (_randGen $ _gwWorld w)
-- this function is the reason for the warning suppression
-- remove the warning suppression if it changes
placeWallPoly :: [Point2] -> Wall -> World -> World
placeWallPoly qs wl w = foldl' (addPane wl) w pairs
where
(p : ps) = orderPolygon qs
pairs = zip (ps ++ [p]) (p : ps)
placeWallPoly qs wl w
| (p : ps) <- orderPolygon qs = foldl' (addPane wl) w $ zip (ps ++ [p]) (p : ps)
| otherwise = error "tried to place wall poly with too few points"
addPane :: Wall -> World -> (Point2, Point2) -> World
addPane wl w l =