Refactor, try to limit dependencies

This commit is contained in:
2022-07-28 00:59:56 +01:00
parent 8aa5c17ab9
commit 160560af5f
418 changed files with 15104 additions and 13342 deletions
+28 -31
View File
@@ -1,50 +1,47 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE StrictData #-}
module Dodge.Data.Creature.Stance
where
import GHC.Generics
import Data.Aeson
import Geometry.Data
{-# LANGUAGE TemplateHaskell #-}
module Dodge.Data.Creature.Stance where
import Control.Lens
data Stance = Stance
{_carriage :: Carriage
,_posture :: Posture
,_strideLength :: Int
import Data.Aeson
import Data.Aeson.TH
import Geometry.Data
data Stance = Stance
{ _carriage :: Carriage
, _posture :: Posture
, _strideLength :: Int
}
deriving (Eq,Ord,Show,Read,Generic)
instance ToJSON Stance where
toEncoding = genericToEncoding defaultOptions
instance FromJSON Stance
data Carriage
= Walking
{ _strideAmount :: Int
deriving (Eq, Ord, Show, Read)
data Carriage
= Walking
{ _strideAmount :: Int
, _currentFoot :: FootForward
}
| Standing
| Floating
| Flying
| Boosting Point2
deriving (Eq,Ord,Show,Read,Generic)
instance ToJSON Carriage where
toEncoding = genericToEncoding defaultOptions
instance FromJSON Carriage
deriving (Eq, Ord, Show, Read)
data FootForward
= LeftForward
| RightForward
| WasLeftForward
| WasRightForward
deriving (Eq,Ord,Show,Read,Generic)
instance ToJSON FootForward where
toEncoding = genericToEncoding defaultOptions
instance FromJSON FootForward
data Posture = Aiming
deriving (Eq, Ord, Show, Read)
data Posture
= Aiming
| AtEase
deriving (Eq,Ord,Show,Read,Generic)
instance ToJSON Posture where
toEncoding = genericToEncoding defaultOptions
instance FromJSON Posture
deriving (Eq, Ord, Show, Read)
makeLenses ''Stance
makeLenses ''Carriage
makeLenses ''Posture
deriveJSON defaultOptions ''Stance
deriveJSON defaultOptions ''Carriage
deriveJSON defaultOptions ''FootForward
deriveJSON defaultOptions ''Posture