Cleanup, split CWorld into separate file
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
module Dodge.Data.Creature.Stance
|
||||
where
|
||||
import GHC.Generics
|
||||
import Data.Aeson
|
||||
import Geometry.Data
|
||||
|
||||
import Control.Lens
|
||||
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
|
||||
, _currentFoot :: FootForward
|
||||
}
|
||||
| Standing
|
||||
| Floating
|
||||
| Flying
|
||||
| Boosting Point2
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON Carriage where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON Carriage
|
||||
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
|
||||
| AtEase
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON Posture where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON Posture
|
||||
makeLenses ''Stance
|
||||
makeLenses ''Carriage
|
||||
makeLenses ''Posture
|
||||
Reference in New Issue
Block a user