Add Store instances

This commit is contained in:
2022-08-21 12:21:05 +01:00
parent 1ce7d4a72d
commit dd62e30026
92 changed files with 465 additions and 255 deletions
+6 -4
View File
@@ -5,6 +5,8 @@
module Dodge.Data.Creature.Stance where
import TH.Derive
import Data.Store
import Data.Binary
import Flat
import LinearHelp ()
@@ -19,7 +21,6 @@ data Stance = Stance
, _strideLength :: Int
}
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary Stance
data Carriage
= Walking
@@ -31,7 +32,6 @@ data Carriage
| Flying
| Boosting Point2
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary Carriage
data FootForward
= LeftForward
@@ -39,13 +39,12 @@ data FootForward
| WasLeftForward
| WasRightForward
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary FootForward
data Posture
= Aiming
| AtEase
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary Posture
$($(derive [d| instance Deriving (Store Posture) |]))
makeLenses ''Stance
makeLenses ''Carriage
@@ -54,3 +53,6 @@ deriveJSON defaultOptions ''Stance
deriveJSON defaultOptions ''Carriage
deriveJSON defaultOptions ''FootForward
deriveJSON defaultOptions ''Posture
$($(derive [d| instance Deriving (Store Stance ) |]))
$($(derive [d| instance Deriving (Store Carriage) |]))
$($(derive [d| instance Deriving (Store FootForward) |]))