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
+7 -8
View File
@@ -1,8 +1,11 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
module Dodge.Data.Beam where
import Flat
import Color
import Control.Lens
import Data.Aeson
@@ -28,12 +31,12 @@ data Beam = Beam
, _bmOrigin :: Maybe Int
, _bmType :: BeamType
}
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
data BeamDraw
= BasicBeamDraw
| BeamDrawColor Color
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
data BeamCombineType
= FlameBeamCombine
@@ -41,14 +44,14 @@ data BeamCombineType
| TeslaBeamCombine
| SplitBeamCombine
| NoBeamCombine
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
data BeamType
= BeamCombine
{ _beamCombine :: BeamCombineType -- (Point2 , (Point2,Point2,Beam) , (Point2,Point2,Beam)) -> World -> World
}
| BeamSimple
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
makeLenses ''BeamType
makeLenses ''Beam
@@ -56,7 +59,3 @@ deriveJSON defaultOptions ''BeamType
deriveJSON defaultOptions ''Beam
deriveJSON defaultOptions ''BeamDraw
deriveJSON defaultOptions ''BeamCombineType
$($(derive [d| instance Deriving (Store BeamType) |]))
$($(derive [d| instance Deriving (Store Beam) |]))
$($(derive [d| instance Deriving (Store BeamDraw) |]))
$($(derive [d| instance Deriving (Store BeamCombineType) |]))