33 lines
810 B
Haskell
33 lines
810 B
Haskell
--{-# LANGUAGE DeriveGeneric #-}
|
|
{-# LANGUAGE DeriveAnyClass #-}
|
|
{-# LANGUAGE DeriveGeneric #-}
|
|
{-# LANGUAGE StrictData #-}
|
|
{-# LANGUAGE TemplateHaskell #-}
|
|
|
|
-- | GameRooms contain information about given positions in the world
|
|
module Dodge.GameRoom where
|
|
|
|
import Control.Lens
|
|
import Data.Aeson
|
|
import Data.Aeson.TH
|
|
import Geometry
|
|
|
|
data GameRoom = GameRoom
|
|
{ _grViewpoints :: [Point2]
|
|
, _grViewpointsEx :: [Point2]
|
|
, _grBound :: [Point2]
|
|
, -- | gives direction of room
|
|
_grDir :: Float
|
|
, _grLinkDirs :: [Float]
|
|
, _grName :: String
|
|
}
|
|
deriving (Eq, Ord, Show, Read) --, Generic) --Generic, Flat)
|
|
|
|
--instance ToJSON GameRoom where
|
|
-- toEncoding = genericToEncoding defaultOptions
|
|
--
|
|
--instance FromJSON GameRoom
|
|
|
|
makeLenses ''GameRoom
|
|
deriveJSON defaultOptions ''GameRoom
|