33 lines
762 B
Haskell
33 lines
762 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 Flat
|
|
import Control.Lens
|
|
import Data.Aeson
|
|
import Geometry
|
|
import LinearHelp ()
|
|
|
|
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, Flat)
|
|
|
|
instance ToJSON GameRoom where
|
|
toEncoding = genericToEncoding defaultOptions
|
|
|
|
instance FromJSON GameRoom
|
|
|
|
makeLenses ''GameRoom
|