Simplify item placement during generation
This commit is contained in:
+11
-4
@@ -51,8 +51,8 @@ placeSpot :: PlacementSpot -> World -> World
|
||||
placeSpot ps w = case ps of
|
||||
PS {_psPos = p, _psRot = rot, _psType = PutButton bt}
|
||||
-> placeBt bt p rot w
|
||||
PS {_psPos = p, _psRot = rot, _psType = PutFlIt fi}
|
||||
-> placeFlIt fi p rot w
|
||||
PS {_psPos = p, _psRot = rot, _psType = PutFlIt itm}
|
||||
-> placeFlIt itm p rot w
|
||||
PS {_psPos = p, _psRot = rot, _psType = PutCrit cr}
|
||||
-> placeCr cr p rot w
|
||||
PS {_psPos = p, _psRot = rot, _psType = PutLS ls dec}
|
||||
@@ -134,8 +134,15 @@ addPane c (p0,p1) wls = IM.insert (newKey wls) (Wall { _wlLine = [p0,p1]
|
||||
|
||||
placeBt bt p rot w = over buttons addBT w
|
||||
where addBT bts = IM.insert (newKey bts) (bt {_btPos = p, _btRot = rot, _btID = newKey bts}) bts
|
||||
placeFlIt fi p rot w = over floorItems addFI w
|
||||
where addFI fis = IM.insert (newKey fis) (fi {_flItPos = p, _flItRot = rot, _flItID = newKey fis}) fis
|
||||
placeFlIt itm p rot w = over floorItems addFI w
|
||||
where addFI fis = IM.insert (newKey fis)
|
||||
(FlIt
|
||||
{_flItPos = p
|
||||
, _flItRot = rot
|
||||
, _flItID = newKey fis
|
||||
, _flIt = itm
|
||||
}
|
||||
) fis
|
||||
placePressPlate pp p rot w = over pressPlates addPP w
|
||||
where addPP pps = IM.insert (newKey pps) (pp {_ppPos = p,_ppRot = rot}) pps
|
||||
|
||||
|
||||
Reference in New Issue
Block a user