conways-game-of-life/Graphics/Command.hs

17 lines
381 B
Haskell
Raw Normal View History

2021-12-29 18:51:48 -05:00
module Graphics.Command where
import FRP.Yampa (Time, Event)
data Command
= Resize (Int, Int)
| ChangeSpeed (Time -> Time)
getResize :: Command -> Maybe (Int, Int)
getResize (Resize size) = Just size
getResize _ = Nothing
getChangeSpeed :: Command -> Maybe (Time -> Time)
getChangeSpeed (ChangeSpeed f) = Just f
getChangeSpeed _ = Nothing
type CommandEvent = Event Command