module Rattletrap.Decode.CamSettingsAttribute
  ( decodeCamSettingsAttributeBits
  )
where

import Rattletrap.Decode.Common
import Rattletrap.Decode.Float32le
import Rattletrap.Type.CamSettingsAttribute

decodeCamSettingsAttributeBits
  :: (Int, Int, Int) -> DecodeBits CamSettingsAttribute
decodeCamSettingsAttributeBits :: (Int, Int, Int) -> DecodeBits CamSettingsAttribute
decodeCamSettingsAttributeBits (Int, Int, Int)
version =
  Float32le
-> Float32le
-> Float32le
-> Float32le
-> Float32le
-> Float32le
-> Maybe Float32le
-> CamSettingsAttribute
CamSettingsAttribute
    (Float32le
 -> Float32le
 -> Float32le
 -> Float32le
 -> Float32le
 -> Float32le
 -> Maybe Float32le
 -> CamSettingsAttribute)
-> BitGet Float32le
-> BitGet
     (Float32le
      -> Float32le
      -> Float32le
      -> Float32le
      -> Float32le
      -> Maybe Float32le
      -> CamSettingsAttribute)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> BitGet Float32le
decodeFloat32leBits
    BitGet
  (Float32le
   -> Float32le
   -> Float32le
   -> Float32le
   -> Float32le
   -> Maybe Float32le
   -> CamSettingsAttribute)
-> BitGet Float32le
-> BitGet
     (Float32le
      -> Float32le
      -> Float32le
      -> Float32le
      -> Maybe Float32le
      -> CamSettingsAttribute)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> BitGet Float32le
decodeFloat32leBits
    BitGet
  (Float32le
   -> Float32le
   -> Float32le
   -> Float32le
   -> Maybe Float32le
   -> CamSettingsAttribute)
-> BitGet Float32le
-> BitGet
     (Float32le
      -> Float32le
      -> Float32le
      -> Maybe Float32le
      -> CamSettingsAttribute)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> BitGet Float32le
decodeFloat32leBits
    BitGet
  (Float32le
   -> Float32le
   -> Float32le
   -> Maybe Float32le
   -> CamSettingsAttribute)
-> BitGet Float32le
-> BitGet
     (Float32le -> Float32le -> Maybe Float32le -> CamSettingsAttribute)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> BitGet Float32le
decodeFloat32leBits
    BitGet
  (Float32le -> Float32le -> Maybe Float32le -> CamSettingsAttribute)
-> BitGet Float32le
-> BitGet (Float32le -> Maybe Float32le -> CamSettingsAttribute)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> BitGet Float32le
decodeFloat32leBits
    BitGet (Float32le -> Maybe Float32le -> CamSettingsAttribute)
-> BitGet Float32le
-> BitGet (Maybe Float32le -> CamSettingsAttribute)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> BitGet Float32le
decodeFloat32leBits
    BitGet (Maybe Float32le -> CamSettingsAttribute)
-> BitGet (Maybe Float32le) -> DecodeBits CamSettingsAttribute
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Bool -> BitGet Float32le -> BitGet (Maybe Float32le)
forall (m :: * -> *) (f :: * -> *) a.
(Applicative m, Alternative f) =>
Bool -> m a -> m (f a)
decodeWhen ((Int, Int, Int)
version (Int, Int, Int) -> (Int, Int, Int) -> Bool
forall a. Ord a => a -> a -> Bool
>= (Int
868, Int
20, Int
0)) BitGet Float32le
decodeFloat32leBits