Move towards using item structural function when using items
This commit is contained in:
@@ -13,6 +13,7 @@ module Dodge.Data.Item (
|
||||
module Dodge.Data.Item.Location,
|
||||
) where
|
||||
|
||||
import Geometry.Data
|
||||
import qualified Data.IntMap.Strict as IM
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
@@ -35,6 +36,7 @@ data Item = Item
|
||||
, _itID :: NewInt ItmInt
|
||||
, _itLocation :: ItemLocation
|
||||
, _itEffect :: ItEffect
|
||||
, _itTargeting :: ItemTargeting
|
||||
, _itAmmoSlots :: IM.IntMap AmmoType
|
||||
, _itInvSize :: Int
|
||||
, _itDimension :: ItemDimension
|
||||
@@ -42,6 +44,15 @@ data Item = Item
|
||||
, _itParams :: ItemParams
|
||||
}
|
||||
|
||||
data ItemTargeting = NoItTargeting
|
||||
| ItTargeting
|
||||
{ _itTgPos :: Maybe Point2
|
||||
, _itTgID :: Maybe Int
|
||||
, _itTgActive :: Bool
|
||||
}
|
||||
|
||||
makeLenses ''ItemTargeting
|
||||
makeLenses ''Item
|
||||
deriveJSON defaultOptions ''ItemTargeting
|
||||
deriveJSON defaultOptions ''ItID
|
||||
deriveJSON defaultOptions ''Item
|
||||
|
||||
@@ -58,11 +58,11 @@ data ItemUse
|
||||
, _amagType :: AmmoType
|
||||
}
|
||||
| UseScope { _uScope :: Scope }
|
||||
| UseTargeting
|
||||
{ _tgPos :: Maybe Point2
|
||||
, _tgID :: Maybe Int
|
||||
, _tgActive :: Bool
|
||||
}
|
||||
-- | UseTargeting
|
||||
-- { _tgPos :: Maybe Point2
|
||||
-- , _tgID :: Maybe Int
|
||||
-- , _tgActive :: Bool
|
||||
-- }
|
||||
| UseBulletMod { _ubMod :: BulletMod }
|
||||
deriving (Eq, Show, Read)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user