50 lines
1.1 KiB
Haskell
50 lines
1.1 KiB
Haskell
{-# LANGUAGE DeriveGeneric #-}
|
|
{-# LANGUAGE DeriveAnyClass #-}
|
|
{-# LANGUAGE StrictData #-}
|
|
{-# LANGUAGE TemplateHaskell #-}
|
|
|
|
module Dodge.Data.Creature.Stance
|
|
( module Dodge.Data.Creature.Stance
|
|
, module Dodge.Data.AimStance
|
|
)where
|
|
|
|
import Dodge.Data.AimStance
|
|
import Control.Lens
|
|
import Data.Aeson
|
|
import Data.Aeson.TH
|
|
import Geometry.Data
|
|
|
|
data Stance = Stance
|
|
{ _carriage :: Carriage
|
|
, _posture :: Posture
|
|
, _strideLength :: Float
|
|
}
|
|
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
|
|
data Carriage
|
|
= Walking
|
|
{ _strideAmount :: Float
|
|
, _currentFoot :: FootForward
|
|
}
|
|
| Standing
|
|
| Floating
|
|
| Flying
|
|
| Boosting Point2
|
|
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
|
|
data FootForward = LeftForward | RightForward
|
|
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
|
|
data Posture
|
|
= Aiming {_aimStance :: AimStance}
|
|
| AtEase
|
|
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
|
|
makeLenses ''Stance
|
|
makeLenses ''Carriage
|
|
makeLenses ''Posture
|
|
deriveJSON defaultOptions ''FootForward
|
|
deriveJSON defaultOptions ''Posture
|
|
deriveJSON defaultOptions ''Carriage
|
|
deriveJSON defaultOptions ''Stance
|