module EventLoop.Input.SystemMessage(
    SystemMessageIn(..)
) where

import EventLoop.Json
import EventLoop.Config

-- System Messages In
data SystemMessageIn = Setup
                     | Background
                     | Time
                     
instance FromJSON SystemMessageIn where
    fromJsonMessage (JSONObject ms) | message == setupS      = Setup
                                    | message == backgroundS = Background
                                    | message == timeS       = Time
                                      where
                                          JSONString message = retrieveError messageS ms