Cleanup
This commit is contained in:
+50
-45
@@ -1,75 +1,80 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
module Dodge.Data.Item.Use
|
||||
( module Dodge.Data.Item.Use
|
||||
, module Dodge.Data.Equipment
|
||||
)
|
||||
where
|
||||
import GHC.Generics
|
||||
import Data.Aeson
|
||||
import Dodge.Data.Item.HeldUse
|
||||
import Dodge.Data.Item.HeldScroll
|
||||
import Dodge.Data.Item.UseDelay
|
||||
import Dodge.Data.Hammer
|
||||
import Dodge.Data.Equipment
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
module Dodge.Data.Item.Use (
|
||||
module Dodge.Data.Item.Use,
|
||||
module Dodge.Data.Item.Use.Equipment,
|
||||
module Dodge.Data.Item.HeldUse,
|
||||
module Dodge.Data.Item.HeldScroll,
|
||||
module Dodge.Data.Item.UseDelay,
|
||||
) where
|
||||
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Dodge.Data.Hammer
|
||||
import Dodge.Data.Item.HeldScroll
|
||||
import Dodge.Data.Item.HeldUse
|
||||
import Dodge.Data.Item.Use.Equipment
|
||||
import Dodge.Data.Item.UseDelay
|
||||
import GHC.Generics
|
||||
|
||||
data ItemUse
|
||||
= RightUse
|
||||
{ _rUse :: HeldUse -- Item -> Creature -> World -> World
|
||||
, _useDelay :: UseDelay
|
||||
, _useMods :: HeldMod --[(Item -> Creature -> World -> World) -> Item -> Creature -> World -> World]
|
||||
, _useHammer :: HammerPosition
|
||||
, _useAim :: AimParams
|
||||
, _heldScroll :: HeldScroll --Float -> Creature -> Item -> Item
|
||||
= RightUse
|
||||
{ _rUse :: HeldUse
|
||||
, _useDelay :: UseDelay
|
||||
, _useMods :: HeldMod
|
||||
, _useHammer :: HammerPosition
|
||||
, _useAim :: AimParams
|
||||
, _heldScroll :: HeldScroll
|
||||
}
|
||||
| LeftUse
|
||||
{ _lUse :: Luse --Item -> Creature -> World -> World
|
||||
, _useDelay :: UseDelay
|
||||
, _useHammer :: HammerPosition
|
||||
, _eqEq :: Equipment
|
||||
| LeftUse
|
||||
{ _lUse :: Luse
|
||||
, _useDelay :: UseDelay
|
||||
, _useHammer :: HammerPosition
|
||||
, _eqEq :: Equipment
|
||||
}
|
||||
| ConsumeUse
|
||||
{ _cUse :: Cuse --Item -> Creature -> World -> World
|
||||
| ConsumeUse
|
||||
{ _cUse :: Cuse
|
||||
}
|
||||
| EquipUse
|
||||
| EquipUse
|
||||
{ _eqEq :: Equipment
|
||||
}
|
||||
| NoUse
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
deriving (Eq, Ord, Show, Read, Generic)
|
||||
instance ToJSON ItemUse where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON ItemUse
|
||||
data AimParams = AimParams
|
||||
{ _aimWeight :: Int
|
||||
, _aimRange :: Float
|
||||
, _aimZoom :: ItZoom
|
||||
, _aimStance :: AimStance
|
||||
{ _aimWeight :: Int
|
||||
, _aimRange :: Float
|
||||
, _aimZoom :: ItZoom
|
||||
, _aimStance :: AimStance
|
||||
, _aimHandlePos :: Float
|
||||
, _aimMuzPos :: Float
|
||||
, _aimMuzPos :: Float
|
||||
}
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON AimParams where
|
||||
deriving (Eq, Ord, Show, Read, Generic)
|
||||
instance ToJSON AimParams where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON AimParams
|
||||
instance FromJSON AimParams
|
||||
data AimStance
|
||||
= TwoHandTwist
|
||||
| TwoHandFlat
|
||||
| OneHand
|
||||
| LeaveHolstered
|
||||
deriving (Eq,Show,Ord,Enum,Read,Generic)
|
||||
deriving (Eq, Show, Ord, Enum, Read, Generic)
|
||||
instance ToJSON AimStance where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON AimStance
|
||||
data ItZoom = ItZoom
|
||||
{ _itZoomMax :: Float
|
||||
, _itZoomMin :: Float
|
||||
, _itZoomFac :: Float
|
||||
data ItZoom = ItZoom
|
||||
{ _itZoomMax :: Float
|
||||
, _itZoomMin :: Float
|
||||
, _itZoomFac :: Float
|
||||
}
|
||||
deriving (Eq,Ord,Show,Read,Generic)
|
||||
instance ToJSON ItZoom where
|
||||
deriving (Eq, Ord, Show, Read, Generic)
|
||||
instance ToJSON ItZoom where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
instance FromJSON ItZoom
|
||||
instance FromJSON ItZoom
|
||||
makeLenses ''ItemUse
|
||||
makeLenses ''AimParams
|
||||
makeLenses ''ItZoom
|
||||
|
||||
Reference in New Issue
Block a user