Attempt to improve perfomance

This commit is contained in:
2022-08-25 09:52:12 +01:00
parent 6973663055
commit 920bfdbc8e
18 changed files with 60 additions and 311 deletions
+3 -1
View File
@@ -46,7 +46,7 @@ generateLevelFromRoomList gr' w =
& cWorld . cwGen . cwgGameRooms .~ gameRoomsFromRooms (IM.elems rs')
& cWorld . pathGraph .~ path
& cWorld . pnZoning .~ foldl' (flip zonePn) mempty (labNodes path)
& cWorld . peZoning .~ foldl' (flip zonePe) mempty (labEdges path)
& cWorld . peZoning .~ foldl' (flip zonePe) mempty (map fromEdgeTuple $ labEdges path)
where
(_, path) = pairsToGraph pairPath'
pairPath = foldMap _rmPath rs
@@ -54,6 +54,8 @@ generateLevelFromRoomList gr' w =
rs = map doRoomShift $ IM.elems rs'
rs' = mapM shuffleRoomPos gr' & evalState $ _randGen w
fromEdgeTuple :: (Int,Int,PathEdge) -> PathEdgeNodes
fromEdgeTuple (a,b,pe) = PathEdgeNodes a b pe
randomCompass :: World -> World
randomCompass w = w & cWorld . cwCam . cwcRot .~ (takeOne [0, 0.5 * pi, pi, 1.5 * pi] & evalState $ _randGen w)