Files
loop/src/Dodge/Data/Item/Scope.hs
T

32 lines
898 B
Haskell

{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
module Dodge.Data.Item.Scope where
import Control.Lens
import Data.Aeson
import Data.Aeson.TH
import Geometry.Data
data Scope
= NoScope
| OpticScope
{ -- | a camera offset
_opticPos :: Point2 -- this should be relative to the camera rotation
-- this means that when the camera rotates when firing etc,
-- this doesn't need to be changed
, _opticZoom :: Float
, _opticDefaultZoom :: Float
}
| RemoteScope
{ -- | a camera offset, note unlike the optic pos this is absolute
_remotePos :: Point2
, _remoteZoom :: Float
}
deriving (Eq, Show, Read) --Generic, Flat)
makeLenses ''Scope
deriveJSON defaultOptions ''Scope