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
+6 -6
View File
@@ -1,8 +1,11 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
module Dodge.Data.Magnet where
import Flat
import LinearHelp
import Control.Lens
import Data.Aeson
@@ -12,12 +15,12 @@ import TH.Derive
import Data.Store
newtype MagnetUpdate = MagnetUpdateTimer Int
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
data MagnetBuBu
= MagnetBuId
| MagnetBuBuCurveAroundField Float Float
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
data Magnet = Magnet
{ _mgID :: Int
@@ -25,12 +28,9 @@ data Magnet = Magnet
, _mgPos :: Point2
, _mgField :: MagnetBuBu
}
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
makeLenses ''Magnet
deriveJSON defaultOptions ''MagnetUpdate
deriveJSON defaultOptions ''MagnetBuBu
deriveJSON defaultOptions ''Magnet
$($(derive [d| instance Deriving (Store MagnetUpdate) |]))
$($(derive [d| instance Deriving (Store MagnetBuBu) |]))
$($(derive [d| instance Deriving (Store Magnet) |]))