19 lines
467 B
Haskell
19 lines
467 B
Haskell
module Dodge.Room.CheckConsistency where
|
|
|
|
import Dodge.Data.GenWorld
|
|
import Dodge.Graph
|
|
import Dodge.RoomLink
|
|
|
|
linksOnPath :: Room -> Bool
|
|
linksOnPath r = all pointOnPath linkPoints
|
|
where
|
|
linkPoints = map (fst . lnkPosDir) $ _rmLinks r
|
|
pointOnPath p = elem p $ concatMap flat2 $ _rmPath r
|
|
flat2 (x,y) = [x,y]
|
|
|
|
pathConnected :: Room -> Bool
|
|
pathConnected = isSingleton . pairsToSCC . _rmPath
|
|
where
|
|
isSingleton [_] = True
|
|
isSingleton _ = False
|