Attempt to improve perfomance
This commit is contained in:
+3
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user