Remove old zoning code
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
module Dodge.Zone.Update (
|
||||
--updateZoning,
|
||||
) where
|
||||
|
||||
import Dodge.Data.Zoning
|
||||
import Geometry
|
||||
import qualified IntMapHelp as IM
|
||||
import LensHelp
|
||||
import qualified Streaming.Prelude as S
|
||||
|
||||
updateZoning :: Monoid (t a) => (a -> t a -> t a) -> a -> Zoning t a -> Zoning t a
|
||||
{-# INLINE updateZoning #-}
|
||||
updateZoning f obj zn = runIdentity (S.fold_ doinsert zn id (_znFunc zn (_znSize zn) obj))
|
||||
where
|
||||
doinsert znobs vxy = insertInZoneWith vxy (\_ -> f obj) (f obj mempty) znobs
|
||||
|
||||
insertInZoneWith ::
|
||||
Int2 ->
|
||||
-- | Combining function
|
||||
(t a -> t a -> t a) ->
|
||||
-- | Value to insert
|
||||
t a ->
|
||||
Zoning t a ->
|
||||
Zoning t a
|
||||
{-# INLINE insertInZoneWith #-}
|
||||
insertInZoneWith (V2 x y) fun obj = over znObjects $ IM.insertWith f x $ IM.singleton y obj
|
||||
where
|
||||
f _ = IM.insertWith fun y obj
|
||||
Reference in New Issue
Block a user