From be689da9bfbcb976135f81be5b5293c465f8f3ba Mon Sep 17 00:00:00 2001 From: nek0 Date: Fri, 6 Jan 2023 16:03:01 +0100 Subject: [PATCH] add utility module --- src/Util.hs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/Util.hs diff --git a/src/Util.hs b/src/Util.hs new file mode 100644 index 0000000..78e83db --- /dev/null +++ b/src/Util.hs @@ -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)