41 lines
858 B
Haskell
41 lines
858 B
Haskell
--{-# LANGUAGE DeriveAnyClass #-}
|
|
{-# LANGUAGE DeriveGeneric #-}
|
|
{-# LANGUAGE StrictData #-}
|
|
{-# LANGUAGE TemplateHaskell #-}
|
|
|
|
module Dodge.Data.Button where
|
|
|
|
import Color
|
|
import Control.Lens
|
|
import Data.Aeson
|
|
import Data.Aeson.TH
|
|
import Dodge.Data.WorldEffect
|
|
import Geometry.Data
|
|
|
|
data ButtonEvent
|
|
= ButtonPress
|
|
{ _btOn :: Bool
|
|
, _bpEff :: WdWd
|
|
, _bpColor :: Color
|
|
}
|
|
| ButtonSwitch
|
|
{ _bonEff :: WdWd
|
|
, _boffEff :: WdWd
|
|
, _bsColor1 :: Color
|
|
, _bsColor2 :: Color
|
|
, _btOn :: Bool
|
|
}
|
|
| ButtonAccessTerminal {_btTermID :: Int}
|
|
|
|
data Button = Button
|
|
{ _btPos :: Point2
|
|
, _btRot :: Float
|
|
, _btEvent :: ButtonEvent
|
|
, _btID :: Int
|
|
}
|
|
|
|
makeLenses ''Button
|
|
makeLenses ''ButtonEvent
|
|
deriveJSON defaultOptions ''ButtonEvent
|
|
deriveJSON defaultOptions ''Button
|