pituicat/src/Affection/StateMachine.hs

21 lines
559 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
2017-03-05 15:39:37 +00:00
class StateMachine a us where
2018-09-25 05:02:33 +00:00
-- | State load routine
2017-03-05 15:39:37 +00:00
smLoad :: a -> Affection us ()
2018-09-25 05:02:33 +00:00
-- | state update routine
2017-03-05 15:39:37 +00:00
smUpdate :: a -> Double -> Affection us ()
2018-09-25 05:02:33 +00:00
-- | State event handler routine
2017-12-16 18:33:43 +00:00
smEvent :: a -> [SDL.EventPayload] -> Affection us ()
2018-09-25 05:02:33 +00:00
-- | State draw routine
2017-03-05 15:39:37 +00:00
smDraw :: a -> Affection us ()
2018-09-25 05:02:33 +00:00
-- | State clean routine
2017-03-05 15:39:37 +00:00
smClean :: a -> Affection us ()