65 lines
1.6 KiB
Haskell
65 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
|
|
, _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 {_opTexture :: Int}
|
|
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 ''WallDraw
|
|
deriveJSON defaultOptions ''Opacity
|
|
deriveJSON defaultOptions ''WallStructure
|
|
deriveJSON defaultOptions ''Wall
|