Move to using RoomLink datatype

This commit is contained in:
2021-11-23 20:45:39 +00:00
parent a66ea1d922
commit 1f2d767d5e
18 changed files with 160 additions and 122 deletions
+2 -1
View File
@@ -2,11 +2,12 @@ module Dodge.Room.CheckConsistency
where
import Dodge.LevelGen.Data
import Dodge.Graph
import Dodge.RoomLink
linksOnPath :: Room -> Bool
linksOnPath r = all pointOnPath linkPoints
where
linkPoints = map fst $ _rmOutLinks r ++ _rmInLinks r
linkPoints = map (fst . lnkPosDir) $ _rmOutLinks r ++ _rmInLinks r
pointOnPath p = elem p $ concatMap flat2 $ _rmPath r
flat2 (x,y) = [x,y]