affection/src/Affection/StateMachine.hs

21 lines
541 B
Haskell

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