affection/src/Affection/StateMachine.hs

21 lines
541 B
Haskell
Raw Normal View History

2017-03-05 15:39:37 +00:00
{-# LANGUAGE MultiParamTypeClasses #-}
module Affection.StateMachine where
import Affection.Types
import qualified SDL
2018-09-25 05:02:33 +00:00
-- | Typeclass for simple scaffolding of a state machine
class StateMachine a where
2018-09-25 05:02:33 +00:00
-- | State load routine
smLoad :: a -> Affection ()
2018-09-25 05:02:33 +00:00
-- | state update routine
smUpdate :: a -> Double -> Affection ()
2018-09-25 05:02:33 +00:00
-- | State event handler routine
smEvent :: a -> [SDL.EventPayload] -> Affection ()
2018-09-25 05:02:33 +00:00
-- | State draw routine
smDraw :: a -> Affection ()
2018-09-25 05:02:33 +00:00
-- | State clean routine
smClean :: a -> Affection ()