pituicat/extern/affection/src/Affection/StateMachine.hs
nek0 58fd609095 Add 'extern/affection/' from commit 'fc6bfa1ca5307e915d44eeac507ccc56ba01b487'
git-subtree-dir: extern/affection
git-subtree-mainline: 9e89962af0
git-subtree-split: fc6bfa1ca5
2020-08-30 17:40:22 +02:00

21 lines
574 B
Haskell

{-# LANGUAGE MultiParamTypeClasses #-}
module Affection.StateMachine where
import Affection.Types
import qualified SDL
-- | Typeclass for simple scaffolding of a state machine
class StateMachine us a where
-- | State load routine
smLoad :: a -> us -> Affection ()
-- | state update routine
smUpdate :: a -> us -> Double -> Affection ()
-- | State event handler routine
smEvent :: a -> us -> [SDL.EventPayload] -> Affection ()
-- | State draw routine
smDraw :: a -> us -> Affection ()
-- | State clean routine
smClean :: a -> us -> Affection ()