Refactor floor items to use centralised items intmap
This commit is contained in:
@@ -112,7 +112,8 @@ placeSpotID' ps pt w = case pt of
|
||||
PutFlIt itm -> let i = IM.newKey (w ^. cWorld . lWorld . itemLocations)
|
||||
in (i, w & cWorld . lWorld . itemLocations . at i ?~ OnFloor
|
||||
& cWorld . lWorld . floorItems . at i ?~ createFlIt p rot
|
||||
(itm & itID .~ NInt i)
|
||||
& cWorld . lWorld . items . at i ?~ (itm & itID .~ NInt i
|
||||
& itLocation .~ OnFloor)
|
||||
)
|
||||
-- plNewUpID
|
||||
-- (cWorld . lWorld . floorItems . unNIntMap)
|
||||
@@ -181,8 +182,8 @@ mvButton :: Point2 -> Float -> Button -> Button
|
||||
mvButton p a = (btRot +~ a) . (btPos %~ ((p +.+) . rotateV a))
|
||||
|
||||
{- Creates a floor item at a given point.-}
|
||||
createFlIt :: Point2 -> Float -> Item -> FloorItem
|
||||
createFlIt p rot itm = FlIt{_flItPos = p, _flItRot = rot, _flIt = itm}
|
||||
createFlIt :: Point2 -> Float -> FloorItem
|
||||
createFlIt p rot = FlIt{_flItPos = p, _flItRot = rot}
|
||||
|
||||
mvPP :: Point2 -> Float -> PressPlate -> PressPlate
|
||||
mvPP p rot pp = pp{_ppPos = p, _ppRot = rot}
|
||||
|
||||
Reference in New Issue
Block a user