Files
loop/src/Dodge/Creature/Update.hs
T
2021-05-17 22:39:18 +02:00

16 lines
436 B
Haskell

module Dodge.Creature.Update
where
import Dodge.Data
import System.Random
-- combinators for helping with dealing with creature update
type CRUpdate = World -> (World -> World,StdGen) -> Creature -> ((World -> World,StdGen), Maybe Creature)
unrandUpdate
:: (Creature -> World -> World)
-> (Creature -> Maybe Creature)
-> CRUpdate
{-# INLINE unrandUpdate #-}
unrandUpdate h cF _ (f,g) cr = ( ( h cr . f , g) , cF cr )