Add more information to Room Positions
This commit is contained in:
@@ -49,8 +49,9 @@ roomRect x y xn yn = defaultRoom
|
||||
, _rmLinks = lnks
|
||||
, _rmName = "rect"
|
||||
, _rmPath = concatMap doublePair pth
|
||||
, _rmPos = map (roomposat RoomPosOnPath) posps
|
||||
++ map (roomposat RoomPosOffPath) interposps
|
||||
--, _rmPos = map (roomposat (RoomPosOnPath S.empty)) posps
|
||||
, _rmPos = map (makeonpos) posps'
|
||||
++ map (roomposat (RoomPosOffPath S.empty)) interposps
|
||||
, _rmPmnts = []
|
||||
, _rmBound = [rectNSWE (y+5) (-5) (-5) (x+5)]
|
||||
, _rmFloor = Tiled [Tile
|
||||
@@ -85,6 +86,14 @@ roomRect x y xn yn = defaultRoom
|
||||
m edge edgefrom1 edgefrom2 = zipWith (lnkBothAnd (OnEdge edge) edgefrom1 edgefrom2) [0..]
|
||||
. zipCountDown
|
||||
pth = linksAndPath' lnks $ map (bimap (+.+ V2 20 20) (+.+ V2 20 20)) (makeGrid xd xn yd yn)
|
||||
makeonpos (p,a) = RoomPos p 0 (S.singleton $ RoomPosOnPath $ makerpedges a) NotLink 0
|
||||
makerpedges (a,b) = S.fromList
|
||||
[PathFromEdge South b
|
||||
,PathFromEdge North (yn-b)
|
||||
,PathFromEdge East (yn-a)
|
||||
,PathFromEdge West a
|
||||
]
|
||||
posps' = map (over _1 (+.+ V2 20 20)) $ gridPoints'' xd (xn+1) yd (xn+1)
|
||||
posps = map (+.+ V2 20 20) $ gridPoints xd (xn+1) yd (yn+1)
|
||||
interposps = map (+.+ V2 (20 + xd/2) (20 + yd/2)) $ gridPoints xd xn yd yn
|
||||
|
||||
|
||||
Reference in New Issue
Block a user