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
+9 -12
View File
@@ -1,8 +1,11 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
module Dodge.Data.ActionPlan where
import Flat
import Control.Lens
import Data.Aeson
import Data.Aeson.TH
@@ -21,12 +24,12 @@ data ActionPlan
, _apStrategy :: Strategy
, _apGoal :: [Goal]
}
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
data RandImpulse
= RandImpulseList [Impulse]
| RandImpulseCircMove Float
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
data Impulse
= Move Point2
@@ -60,7 +63,7 @@ data Impulse
{ _impulseUseAheadPos :: P2Imp
}
| ImpulseNothing
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
infixr 9 `WaitThen`
@@ -167,7 +170,7 @@ data Action
{ _sideImpulses :: [Impulse]
, _mainAction :: Action
}
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
data Strategy
= Flank Int
@@ -185,13 +188,13 @@ data Strategy
| Reload
| Flee
| MeleeStrike
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
data Goal
= LiveLongAndProsper
| Kill Int
| SentinelAt Point2 Float
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
deriveJSON defaultOptions ''ActionPlan
deriveJSON defaultOptions ''RandImpulse
@@ -202,9 +205,3 @@ deriveJSON defaultOptions ''Goal
makeLenses ''ActionPlan
makeLenses ''Impulse
makeLenses ''Action
$($(derive [d| instance Deriving (Store ActionPlan) |]))
$($(derive [d| instance Deriving (Store RandImpulse) |]))
$($(derive [d| instance Deriving (Store Impulse) |]))
$($(derive [d| instance Deriving (Store Action) |]))
$($(derive [d| instance Deriving (Store Strategy) |]))
$($(derive [d| instance Deriving (Store Goal) |]))