Files
loop/src/Dodge/Data/Wall.hs
T
2025-10-24 18:50:09 +01:00

45 lines
1.2 KiB
Haskell

{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
module Dodge.Data.Wall (
module Dodge.Data.Wall,
module Dodge.Data.Wall.Structure,
module Dodge.Data.Material,
) where
import Control.Lens
import Data.Aeson
import Data.Aeson.TH
import Dodge.Data.Material
import Dodge.Data.Wall.Structure
import Geometry
data Wall = Wall
{ _wlLine :: (Point2, Point2)
, _wlID :: Int
, _wlOpacity :: Opacity
, _wlTouchThrough :: Bool
, _wlUnshadowed :: Bool
, _wlRotateTo :: Bool
, _wlStructure :: WallStructure
, _wlHeight :: Float
, _wlMaterial :: Material
}
deriving (Eq, Ord, Show, Read) --Generic, Flat)
data Opacity
= SeeThrough
| SeeAbove -- these are not drawn themselves, but the "owning" machine or block should draw them
| DrawnWall {_opDraw :: WallDraw} -- Wall -> SPic
| Opaque {_opTexture :: Int}
deriving (Eq, Ord, Show, Read) --Generic, Flat)
data WallDraw = DrawForceField
deriving (Eq, Ord, Show, Enum, Bounded, Read) --Generic, Flat)
makeLenses ''Wall
makeLenses ''Opacity
deriveJSON defaultOptions ''WallDraw
deriveJSON defaultOptions ''Opacity
deriveJSON defaultOptions ''Wall