56 lines
1.2 KiB
Haskell
56 lines
1.2 KiB
Haskell
{-# LANGUAGE DeriveAnyClass #-}
|
|
{-# LANGUAGE DeriveGeneric #-}
|
|
{-# LANGUAGE StrictData #-}
|
|
{-# LANGUAGE TemplateHaskell #-}
|
|
|
|
module Dodge.Data.CWorld (
|
|
module Dodge.Data.CWorld,
|
|
module Dodge.Data.LWorld,
|
|
module Dodge.Data.Camera
|
|
) where
|
|
|
|
import Data.Tile
|
|
import Geometry.Data
|
|
import Dodge.Data.LWorld
|
|
import Control.Lens
|
|
import Data.Aeson
|
|
import Data.Aeson.TH
|
|
--import Dodge.Data.GenParams
|
|
import Dodge.GameRoom
|
|
import Geometry.ConvexPoly
|
|
import Dodge.Data.Camera
|
|
import qualified Data.IntSet as IS
|
|
import Data.Graph.Inductive
|
|
|
|
data CWorld = CWorld
|
|
{ _lWorld :: LWorld
|
|
, _cwCam :: Camera
|
|
, _cwGen :: CWGen
|
|
, _cClock :: Int
|
|
, _seenWalls :: IS.IntSet
|
|
, _cwTiles :: [Tile]
|
|
, _pathGraph :: Gr Point2 PathEdge
|
|
, _numberFloorVerxs :: Int
|
|
}
|
|
|
|
data CWGen = CWGen
|
|
{ _cwgParams :: GenParams
|
|
, _cwgWorldBounds :: Bounds
|
|
, _cwgGameRooms :: [GameRoom] -- consider using an IntMap
|
|
, _cwgRoomClipping :: [ConvexPoly]
|
|
, _cwgSeed :: Int
|
|
}
|
|
|
|
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
|
|
|
|
makeLenses ''CWorld
|
|
makeLenses ''CWGen
|
|
concat
|
|
<$> mapM
|
|
(deriveJSON defaultOptions)
|
|
[ ''CWGen
|
|
, ''CWorld
|
|
-- , ''TimeFlowStatus
|
|
]
|