Continue streaming refactor

This commit is contained in:
2022-06-26 01:34:58 +01:00
parent e2d09d57e9
commit ac9181e1a1
4 changed files with 29 additions and 20 deletions
+8 -1
View File
@@ -25,6 +25,7 @@ import LensHelp
import Data.Foldable
import Data.Tuple
import qualified Streaming.Prelude as S
aFlameParticle
:: Int -- ^ Timer
-> Point2 -- ^ Position
@@ -206,7 +207,13 @@ damageInArea crt wlt pt w = damwls damcrs
where
p = _ptPos pt
damcrs = foldl' (flip $ \cr -> fst . hiteff [(p,Left cr)]) w $ IM.filter crt $ _creatures w
damwls w' = foldl' (flip $ \wl -> fst . hiteff [(p,Right wl)]) w' $ filter wlt $ wallsNearPoint' p w
damwls w' = runIdentity
. S.fold_
(flip $ \wl -> fst . hiteff [(p,Right wl)])
w'
id
. S.filter wlt
$ wallsNearPoint p w'
hiteff = _ptHitEff pt pt
-- | At writing the radius is half the size of the effect area