65 lines
1.7 KiB
Haskell
65 lines
1.7 KiB
Haskell
--{-# LANGUAGE DeriveGeneric #-}
|
|
--{-# LANGUAGE DeriveAnyClass #-}
|
|
{-# LANGUAGE StrictData #-}
|
|
{-# LANGUAGE TemplateHaskell #-}
|
|
|
|
module Dodge.Data.Item (
|
|
module Dodge.Data.Item,
|
|
module Dodge.Data.Item.Effect,
|
|
module Dodge.Data.Item.Misc,
|
|
module Dodge.Data.Item.Tweak,
|
|
module Dodge.Data.Item.Params,
|
|
module Dodge.Data.Item.Use,
|
|
module Dodge.Data.Item.CurseStatus,
|
|
module Dodge.Data.Item.Scope,
|
|
module Dodge.Data.Item.Combine,
|
|
module Dodge.Data.Item.Location,
|
|
) where
|
|
|
|
import Color
|
|
import Control.Lens
|
|
import Data.Aeson
|
|
import Data.Aeson.TH
|
|
import Dodge.Data.Item.Combine
|
|
import Dodge.Data.Item.Effect
|
|
import Dodge.Data.Item.Scope
|
|
import Dodge.Data.Item.CurseStatus
|
|
import Dodge.Data.Item.Misc
|
|
import Dodge.Data.Item.Params
|
|
import Dodge.Data.Item.Tweak
|
|
import Dodge.Data.Item.Use
|
|
import Dodge.Data.Item.Location
|
|
import Data.Set (Set)
|
|
|
|
data Item = Item
|
|
{ _itUse :: ItemUse
|
|
, _itType :: ItemType
|
|
, _itID :: Int
|
|
, _itLocation :: ItemLocation
|
|
, _itIsHeld :: Bool
|
|
, _itEffect :: ItEffect
|
|
, _itInvSize :: Float
|
|
, _itInvColor :: Color
|
|
, _itDimension :: ItemDimension
|
|
, _itCurseStatus :: CurseStatus
|
|
, _itTweaks :: ItemTweaks
|
|
, _itScope :: Scope
|
|
, _itParams :: ItemParams
|
|
, _itAttachments :: Set ItemAttachment
|
|
}
|
|
--deriving (Eq, Show, Read) --Generic, Flat)
|
|
|
|
data ItemAttachment = ScopeAttachment
|
|
| BulletClipAttachment
|
|
| BulletBeltAttachment
|
|
| StandAttachment
|
|
| PowerSourceAttachment
|
|
deriving (Eq,Ord)
|
|
|
|
_itUseAimStance :: Item -> AimStance
|
|
_itUseAimStance = _aimStance . _heldAim . _itUse
|
|
|
|
makeLenses ''Item
|
|
deriveJSON defaultOptions ''ItemAttachment
|
|
deriveJSON defaultOptions ''Item
|