Move from store to flat

This commit is contained in:
2022-08-20 17:54:35 +01:00
parent 8571ab9254
commit ff9dbdf068
95 changed files with 793 additions and 748 deletions
+8 -12
View File
@@ -1,3 +1,5 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
@@ -6,15 +8,14 @@ module Dodge.Data.Wall (
module Dodge.Data.Material,
) where
import LinearHelp
import Flat
import LinearHelp ()
import Color
import Control.Lens
import Data.Aeson
import Data.Aeson.TH
import Dodge.Data.Material
import Geometry
import TH.Derive
import Data.Store
data Wall = Wall
{ _wlLine :: (Point2, Point2)
@@ -35,18 +36,17 @@ data Wall = Wall
, _wlHeight :: Float
, _wlMaterial :: Material
}
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
data Opacity
= SeeThrough
| SeeAbove
| DrawnWall {_opDraw :: WallDraw} -- Wall -> SPic
| Opaque
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
data WallDraw = DrawForceField
| HackWallDraw
deriving (Eq, Ord, Show, Read, Enum, Bounded)
deriving (Eq, Ord, Show, Read, Enum, Bounded, Generic, Flat)
data WallStructure
= StandaloneWall
@@ -56,7 +56,7 @@ data WallStructure
| CreaturePart
{ _wlStCreature :: Int
}
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
makeLenses ''Wall
makeLenses ''Opacity
@@ -65,7 +65,3 @@ deriveJSON defaultOptions ''Wall
deriveJSON defaultOptions ''Opacity
deriveJSON defaultOptions ''WallDraw
deriveJSON defaultOptions ''WallStructure
$($(derive [d| instance Deriving (Store Wall) |]))
$($(derive [d| instance Deriving (Store Opacity) |]))
$($(derive [d| instance Deriving (Store WallDraw) |]))
$($(derive [d| instance Deriving (Store WallStructure) |]))