Refactor wall zoning, remove streaming
This commit is contained in:
+12
-3
@@ -1,10 +1,12 @@
|
||||
module Dodge.RadarSweep where
|
||||
import Dodge.Zoning.Wall
|
||||
import Dodge.Data
|
||||
import Dodge.Zone
|
||||
import Color
|
||||
import Geometry
|
||||
import LensHelp
|
||||
|
||||
import Data.Maybe
|
||||
import qualified IntMapHelp as IM
|
||||
import qualified Streaming.Prelude as S
|
||||
|
||||
@@ -68,10 +70,17 @@ itemBlips p r = IM.elems . IM.filter f . fmap _flItPos . _floorItems
|
||||
where
|
||||
f q = dist p q <= r && dist p q > r - 4
|
||||
|
||||
--wallBlips :: Point2 -> Float -> World -> [Point2]
|
||||
--wallBlips p r w = runIdentity . S.toList_ $ S.mapMaybe (uncurry (intersectCircSegFirst p r) . _wlLine)
|
||||
-- $ S.map (over wlLine swp) (wlsInsideCirc p r w)
|
||||
-- <> wlsInsideCirc p r w
|
||||
-- where
|
||||
-- swp (a,b) = (b,a)
|
||||
|
||||
wallBlips :: Point2 -> Float -> World -> [Point2]
|
||||
wallBlips p r w = runIdentity . S.toList_ $ S.mapMaybe (uncurry (intersectCircSegFirst p r) . _wlLine)
|
||||
$ S.map (over wlLine swp) (wlsInsideCirc p r w)
|
||||
<> wlsInsideCirc p r w
|
||||
wallBlips p r w = mapMaybe (uncurry (intersectCircSegFirst p r) . _wlLine)
|
||||
$ map (over wlLine swp) (wlsNearCirc p r w)
|
||||
<> wlsNearCirc p r w
|
||||
where
|
||||
swp (a,b) = (b,a)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user