Change poke to use folding rather than store incremental ints in vector

This commit is contained in:
2022-06-27 15:33:24 +01:00
parent 0def31895f
commit 8b72df2772
9 changed files with 78 additions and 93 deletions
-12
View File
@@ -5,21 +5,15 @@
module Dodge.Placement.PlaceSpot
( placeSpot
) where
--import Dodge.LevelGen.LevelStructure
import Dodge.Placement.Shift
import Dodge.Data
import Dodge.Path
import Dodge.Placement.PlaceSpot.Block
import Dodge.Placement.PlaceSpot.TriggerDoor
--import Dodge.LevelGen.Data
import Dodge.Default.Wall
import Dodge.ShiftPoint
import Dodge.Base.NewID
--import Dodge.RandomHelp
--import Dodge.Placements.Spot
import Geometry
--import Geometry.ConvexPoly
import Shape
import qualified IntMapHelp as IM
import Color
@@ -109,7 +103,6 @@ placeSpotID ps pt w = case pt of
wl w
PutLineBlock wl wdth dpth a b -> placeLineBlock wl wdth dpth (doShift a) (doShift b) w
PutWall qs wl -> (0,placeWallPoly (map doShift qs) wl w)
PutShape sh -> placeShape sh p rot w
PutNothing -> (0,w)
PutID i -> (i, w)
PutWorldUpdate f -> (0, w & f ps)
@@ -121,11 +114,6 @@ placeSpotID ps pt w = case pt of
rot = _psRot ps
doShift = shiftPointBy (p,rot)
placeShape :: Shape -> Point2 -> Float -> World -> (Int, World)
placeShape sh p rot w = (0, w & foregroundShape %~ (newsh <>))
where
newsh = (uncurryV translateSHf p . rotateSH rot) sh
evaluateRandPS :: State StdGen PSType -> PlacementSpot -> World -> (Int,World)
evaluateRandPS rgen ps w = placeSpotID ps evaluatedType (set randGen g w)
where