Add tree structure generation
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
module Dodge.Room.CheckConsistency
|
||||
where
|
||||
import Dodge.Room.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
|
||||
Reference in New Issue
Block a user