Continue to tweak death effects

This commit is contained in:
2022-06-04 15:52:38 +01:00
parent 63af928a1a
commit 582881ca66
13 changed files with 126 additions and 27 deletions
+10
View File
@@ -2,6 +2,16 @@ module Dodge.Base.NewID where
import qualified IntMapHelp as IM
import LensHelp
-- | generalised way of putting a new item into a lensed intmap, returning the
-- new index as well
plNewID :: ALens' b (IM.IntMap a)
-> a
-> b
-> (Int,b)
plNewID l x w = (i,w & l #%~ IM.insert i x)
where
i = IM.newKey $ w ^# l
-- | place an new object into an intmap and update its id
plNewUpID :: ALens' b (IM.IntMap a)
-> ALens' a Int