add utility module

This commit is contained in:
nek0 2023-01-06 16:03:01 +01:00
parent 925359acc3
commit be689da9bf

13
src/Util.hs Normal file
View file

@ -0,0 +1,13 @@
module Util where
import qualified Data.Vector as V
-- internal imports
import Types
getFrame :: EngineData -> Int -> FrameData
getFrame engineData frame =
let frameVector = engineFrames engineData
in
frameVector V.! (frame `mod` V.length frameVector)