16 lines
436 B
Haskell
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 )
|