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