Add IntMapHelper, locate wall cutting bug
This commit is contained in:
+7
-4
@@ -12,6 +12,8 @@ import Dodge.Room.Data
|
||||
import Dodge.Default
|
||||
import Geometry
|
||||
import Dodge.Room.Link
|
||||
import qualified IntMapHelp as IM
|
||||
import Dodge.Debug.LinkDecoration
|
||||
|
||||
import Control.Monad.State
|
||||
import Control.Lens
|
||||
@@ -21,11 +23,12 @@ import System.Random
|
||||
import Data.Tree
|
||||
import Data.Graph.Inductive.Graph (labNodes)
|
||||
import qualified Data.Map as M
|
||||
import qualified Data.IntMap.Strict as IM
|
||||
|
||||
generateFromList :: State StdGen [Room] -> World -> World
|
||||
generateFromList gr w = updateWallZoning
|
||||
generateLevelFromRoomList :: State StdGen [Room] -> World -> World
|
||||
generateLevelFromRoomList gr w = updateWallZoning
|
||||
. placeSpots plmnts
|
||||
. addRoomPolyDecorations rs
|
||||
. addRoomLinkDecorations rs
|
||||
$ w { _walls = wallsFromRooms rs
|
||||
}
|
||||
where
|
||||
@@ -95,7 +98,7 @@ divideWall wl
|
||||
divideWallIn :: Wall -> IM.IntMap Wall -> IM.IntMap Wall
|
||||
divideWallIn wl wls =
|
||||
let (wl':newWls) = divideWall wl
|
||||
k = newKey wls
|
||||
k = IM.newKey wls
|
||||
newWls' = zipWith (\i w -> w {_wlID = i}) [k..] newWls
|
||||
in foldr (\w -> IM.insert (_wlID w) w) wls (wl':newWls')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user