Files
loop/src/Dodge/Room/CheckConsistency.hs
T
2021-11-14 00:39:24 +00:00

18 lines
432 B
Haskell

module Dodge.Room.CheckConsistency
where
import Dodge.LevelGen.Data
import Dodge.Graph
linksOnPath :: Room -> Bool
linksOnPath r = all pointOnPath linkPoints
where
linkPoints = map fst $ _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