module Rattletrap.Encode.Cache
  ( putCache
  )
where

import Rattletrap.Encode.AttributeMapping
import Rattletrap.Encode.List
import Rattletrap.Encode.Word32le
import Rattletrap.Type.Cache

import qualified Data.Binary as Binary

putCache :: Cache -> Binary.Put
putCache :: Cache -> Put
putCache Cache
cache = do
  Word32le -> Put
putWord32 (Cache -> Word32le
cacheClassId Cache
cache)
  Word32le -> Put
putWord32 (Cache -> Word32le
cacheParentCacheId Cache
cache)
  Word32le -> Put
putWord32 (Cache -> Word32le
cacheCacheId Cache
cache)
  (AttributeMapping -> Put) -> List AttributeMapping -> Put
forall a. (a -> Put) -> List a -> Put
putList AttributeMapping -> Put
putAttributeMapping (Cache -> List AttributeMapping
cacheAttributeMappings Cache
cache)