Implement combining of items

This commit is contained in:
2021-12-03 01:56:23 +00:00
parent 8b8d75b016
commit bebc73882a
13 changed files with 190 additions and 56 deletions
+6 -1
View File
@@ -1,5 +1,6 @@
module Dodge.FloorItem
(copyItemToFloor
,copyItemToFloorID
) where
import Dodge.Data
import Dodge.Base
@@ -12,7 +13,11 @@ import Data.Maybe
{- | Copy an item to the floor. -}
copyItemToFloor :: Point2 -> Item -> World -> World
copyItemToFloor pos it w = w'
copyItemToFloor pos it = snd . copyItemToFloorID pos it
{- | Copy an item to the floor, returns the floor item's id. -}
copyItemToFloorID :: Point2 -> Item -> World -> (Int, World)
copyItemToFloorID pos it w = (,) flid $ w'
& floorItems %~ IM.insert flid theflit
& updateLocation
where