pituicat/src/Affection/StateMachine.hs

21 lines
559 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 us where
-- | State load routine
smLoad :: a -> Affection us ()
-- | state update routine
smUpdate :: a -> Double -> Affection us ()
-- | State event handler routine
smEvent :: a -> [SDL.EventPayload] -> Affection us ()
-- | State draw routine
smDraw :: a -> Affection us ()
-- | State clean routine
smClean :: a -> Affection us ()