Files
loop/src/Dodge/Data/Wall.hs
T
2022-08-21 22:41:19 +01:00

66 lines
1.6 KiB
Haskell

{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
module Dodge.Data.Wall (
module Dodge.Data.Wall,
module Dodge.Data.Material,
) where
import Color
import Control.Lens
import Data.Aeson
import Data.Aeson.TH
import Dodge.Data.Material
import Geometry
data Wall = Wall
{ _wlLine :: (Point2, Point2)
, _wlID :: Int
, _wlColor :: Color
, _wlSeen :: Bool
, _wlOpacity :: Opacity
, _wlPathable :: Bool
, _wlPenetrable :: Bool
, _wlBouncy :: Bool
, _wlWalkable :: Bool
, _wlTouchThrough :: Bool
, _wlFireThrough :: Bool
, _wlReflect :: Bool
, _wlUnshadowed :: Bool
, _wlRotateTo :: Bool
, _wlStructure :: WallStructure
, _wlHeight :: Float
, _wlMaterial :: Material
}
deriving (Eq, Ord, Show, Read) --Generic, Flat)
data Opacity
= SeeThrough
| SeeAbove
| DrawnWall {_opDraw :: WallDraw} -- Wall -> SPic
| Opaque
deriving (Eq, Ord, Show, Read) --Generic, Flat)
data WallDraw = DrawForceField
deriving (Eq, Ord, Show, Enum, Bounded, Read) --Generic, Flat)
data WallStructure
= StandaloneWall
| DoorPart {_wsDoor :: Int}
| MachinePart {_wsMachine :: Int}
| BlockPart {_wsBlock :: Int}
| CreaturePart
{ _wlStCreature :: Int
}
deriving (Eq, Ord, Show, Read) --Generic, Flat)
makeLenses ''Wall
makeLenses ''Opacity
makeLenses ''WallStructure
deriveJSON defaultOptions ''Wall
deriveJSON defaultOptions ''Opacity
deriveJSON defaultOptions ''WallDraw
deriveJSON defaultOptions ''WallStructure