module Dodge.WorldEvent.Sound
    ( originIDsAt 
    , originsIDsAt 
    ) where
import Dodge.Data
import Dodge.SoundLogic
import Sound.Data
import Geometry.Data
import RandomHelp

import Control.Lens
originsIDsAt :: [SoundOrigin] -> [SoundID] -> Point2 -> World -> World
originsIDsAt sos sids p w = soundMultiFrom sos p sid Nothing $ set randGen g w
  where
    (sid,g) = _randGen w & runState (takeOne sids)

originIDsAt :: SoundOrigin -> [SoundID] -> Point2 -> World -> World
originIDsAt so sids p w = soundStart so p sid Nothing $ set randGen g w
  where
    (sid,g) = _randGen w & runState (takeOne sids)
