Refactor beams

This commit is contained in:
2022-07-21 00:32:29 +01:00
parent 39117b4dfe
commit e2ccf7296a
10 changed files with 94 additions and 54 deletions
+2 -1
View File
@@ -5,6 +5,7 @@ Description : Simulation update
-}
module Dodge.Update ( updateUniverse ) where
import Dodge.Data
import Dodge.Beam
import Dodge.Projectile.Update
import Dodge.Creature.Update
import Dodge.RadarSweep
@@ -270,7 +271,7 @@ combineBeams wbeams w = w''
combineBeamBeams :: [Beam] -> World -> Beam -> (World,Beam)
combineBeamBeams bms w bm = case intersectBeamBeams bm bms of
(ps,Nothing) -> (w, bm & bmFirstPoints .~ ps)
(ps,Just a) -> (_beamCombine (_bmType bm) a w, bm & bmFirstPoints .~ ps)
(ps,Just a) -> (doBeamCombine (_beamCombine (_bmType bm)) a w, bm & bmFirstPoints .~ ps)
-- intersect a beam with a list of beams.
-- returns the (reversed) travel of the beam up to maybe an intersection point