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 -16
View File
@@ -1,3 +1,5 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE ScopedTypeVariables #-}
@@ -15,6 +17,7 @@ module Dodge.Data.Creature (
module Dodge.Data.Hammer,
) where
import Flat
import LinearHelp
import TH.Derive
import Data.Store
@@ -74,18 +77,17 @@ data Creature = Creature
, _crStatistics :: CreatureStatistics
, _crCamouflage :: CamouflageStatus
}
deriving (Eq, Show, Read)
deriving (Eq, Show, Read, Generic, Flat)
data CreatureCorpse = MakeDefaultCorpse
| HackDefaultCorpse
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
data Intention = Intention
{ _targetCr :: Maybe Creature
, _mvToPoint :: Maybe Point2
, _viewPoint :: Maybe Point2
}
deriving (Eq, Show, Read)
deriving (Eq, Show, Read, Generic, Flat)
crSel :: Creature -> Int
crSel = _iselPos . _crInvSel
@@ -95,15 +97,3 @@ makeLenses ''Intention
deriveJSON defaultOptions ''Creature
deriveJSON defaultOptions ''CreatureCorpse
deriveJSON defaultOptions ''Intention
{- FOURMOLU_DISABLE -}
$($(derive [d|
instance Deriving (Store Intention)
|]))
$($(derive [d|
instance Deriving (Store CreatureCorpse)
|]))
$($(derive [d|
instance Deriving (Store Creature)
|]))
{- FOURMOLU_ENABLE -}