Function for adding random lights to roomNGon
This commit is contained in:
@@ -100,6 +100,8 @@ data PlacementSpot
|
||||
| PSNoShiftCont {_psPos :: Point2, _psRot :: Float}
|
||||
| PSPos
|
||||
{ _psSelect :: RoomPos -> Room -> Maybe (PlacementSpot, RoomPos)
|
||||
-- looks for the first rp for which a rp rm returns Just (ps,rp'),
|
||||
-- replaces the rp with rp'
|
||||
, _psRoomEff :: RoomPos -> Room -> Room
|
||||
, _psFallback :: Maybe Placement
|
||||
}
|
||||
@@ -138,7 +140,7 @@ data Room = Room
|
||||
, _rmPos :: [RoomPos]
|
||||
, _rmPath :: S.Set (Point2, Point2)
|
||||
, _rmPmnts :: [Placement]
|
||||
, _rmInPmnt :: [(Int,GenWorld -> Placement)] -- so far as I can tell,
|
||||
, _rmInPmnt :: [(Int,GenWorld -> State StdGen Placement)] -- so far as I can tell,
|
||||
-- the first Int only determines the order in which these are applied
|
||||
, _rmBound :: [[Point2]]
|
||||
, _rmFloor :: Floor
|
||||
@@ -162,3 +164,12 @@ makeLenses ''RoomType
|
||||
makeLenses ''PSType
|
||||
makeLenses ''PlacementSpot
|
||||
makeLenses ''Placement
|
||||
|
||||
-- I may regret this. I believe it satisfies associativity, but haven't thought
|
||||
-- about it too much.
|
||||
instance Semigroup Placement where
|
||||
p <> q = p & plIDCont %~ f
|
||||
where
|
||||
f g gw pl = case g gw pl of
|
||||
Nothing -> Just q
|
||||
Just r -> Just $ r & plIDCont %~ f
|
||||
|
||||
@@ -38,6 +38,10 @@ data RoomType
|
||||
, _rmWidth :: Float
|
||||
, _rmHeight :: Float
|
||||
}
|
||||
| RoomNgon
|
||||
{ _rmngonSides :: Int
|
||||
, _rmngonSize :: Float
|
||||
}
|
||||
deriving (Eq, Ord)
|
||||
|
||||
data RoomLinkType
|
||||
@@ -81,6 +85,7 @@ data RoomPosFlag
|
||||
= RoomPosOnGrid {_onGridFromEdges :: S.Set PathFromEdge}
|
||||
| RoomPosOffGrid {_offGridFromEdges :: S.Set PathFromEdge}
|
||||
| RoomPosOnFloor
|
||||
| ColoredLightRP
|
||||
deriving (Eq, Ord, Show)
|
||||
|
||||
data UsedPos
|
||||
|
||||
Reference in New Issue
Block a user