Implement combining of items
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user