module Rattletrap.Decode.Property
  ( decodeProperty
  )
where

import Rattletrap.Decode.Common
import Rattletrap.Decode.PropertyValue
import Rattletrap.Decode.Str
import Rattletrap.Decode.Word64le
import Rattletrap.Type.Property

decodeProperty :: Decode Property
decodeProperty :: Decode Property
decodeProperty = do
  Str
kind <- Decode Str
decodeStr
  Str -> Word64le -> PropertyValue Property -> Property
Property Str
kind (Word64le -> PropertyValue Property -> Property)
-> Get Word64le -> Get (PropertyValue Property -> Property)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Get Word64le
decodeWord64le Get (PropertyValue Property -> Property)
-> Get (PropertyValue Property) -> Decode Property
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Decode Property -> Str -> Get (PropertyValue Property)
forall a. Decode a -> Str -> Decode (PropertyValue a)
decodePropertyValue Decode Property
decodeProperty Str
kind