Move streaming data into its own file

This commit is contained in:
2022-06-29 08:05:20 +01:00
parent b1a7e1bf35
commit 5501d6f9b5
12 changed files with 25 additions and 38 deletions
+5 -7
View File
@@ -1,23 +1,21 @@
module Dodge.Wall.Zone
where
import Dodge.Data
import Geometry
import Dodge.Zone
import Dodge.Base
import qualified Data.IntMap.Strict as IM
import Control.Lens
--import Data.Foldable
--import Streaming
import qualified Streaming.Prelude as S
--import qualified Streaming.Prelude as S
insertWallInZones :: Wall -> World -> World
insertWallInZones wl = wlZoning %~ insertInZoning (IM.insert (_wlID wl)) wl
--insertWallInZones wl = wlZoning . znObjects
insertWallInZones wl = wlZoning %~ updateZoning (IM.insert (_wlID wl)) wl
--insertWallInZones wl = wlZoning .updatets
-- %~ (runIdentity . (\wlzns -> S.fold_ doinsert wlzns id (zoneOfWall wl)))
-- where
-- doinsert wlzns (V2 x y) = insertIMInZone x y (_wlID wl) wl wlzns
deleteWallFromZones :: Wall -> World -> World
deleteWallFromZones wl = wlZoning %~ insertInZoning (const $ IM.delete (_wlID wl)) wl
-- %~ flip (foldl' (flip $ \(a,b) -> deleteIMInZone a b (_wlID wl))) (zoneOfWall wl)
deleteWallFromZones wl = wlZoning %~ updateZoning (const $ IM.delete (_wlID wl)) wl
-- %~ flip (foldl' (flip $ \(a,b) updateeIMInZone a b (_wlID wl))) (zoneOfWall wl)