Minor tweaking, argument refining

This commit is contained in:
2022-10-29 12:20:19 +01:00
parent af6cdff063
commit afaef480db
17 changed files with 59 additions and 56 deletions
+3 -3
View File
@@ -4,12 +4,12 @@ module Dodge.Clock (
import Control.Lens
import qualified Data.Vector as V
import Dodge.Data.World
import Dodge.Data.LWorld
clockCycle :: Int -> V.Vector a -> World -> a
clockCycle :: Int -> V.Vector a -> LWorld -> a
{-# INLINEABLE clockCycle #-}
clockCycle tPeriod xs w = xs V.! i
where
l = V.length xs
t = (w ^. cWorld . lWorld . lClock) `mod` (l * tPeriod)
t = (w ^. lClock) `mod` (l * tPeriod)
i = t `div` tPeriod