57 lines
1.3 KiB
Haskell
57 lines
1.3 KiB
Haskell
{-# LANGUAGE StrictData #-}
|
|
{-# LANGUAGE TemplateHaskell #-}
|
|
|
|
module Dodge.Data.Item (
|
|
module Dodge.Data.Item,
|
|
module Dodge.Data.Item.Misc,
|
|
module Dodge.Data.Item.Params,
|
|
module Dodge.Data.Item.Use,
|
|
module Dodge.Data.Item.Scope,
|
|
module Dodge.Data.Item.Combine,
|
|
module Dodge.Data.Item.Location,
|
|
) where
|
|
|
|
import Control.Lens
|
|
import Data.Aeson
|
|
import Data.Aeson.TH
|
|
import Dodge.Data.Item.Combine
|
|
import Dodge.Data.Item.Location
|
|
import Dodge.Data.Item.Misc
|
|
import Dodge.Data.Item.Params
|
|
import Dodge.Data.Item.Scope
|
|
import Dodge.Data.Item.Use
|
|
import Geometry.Data
|
|
import NewInt
|
|
|
|
data Item = Item
|
|
{ _itUse :: ItemUse
|
|
, _itConsumables :: Maybe Int
|
|
, _itType :: ItemType
|
|
, _itID :: NewInt ItmInt
|
|
, _itLocation :: ItemLocation
|
|
, _itTargeting :: ItemTargeting
|
|
, _itParams :: ItemParams
|
|
, _itScroll :: ItemScroll
|
|
, _itTimeLastUsed :: Int
|
|
}
|
|
|
|
data ItemScroll
|
|
= NoItemScroll
|
|
| ItemScrollInt {_itsInt :: Int}
|
|
| ItemScrollIntRange {_itsMax :: Int, _itsRangeInt :: Int}
|
|
|
|
data ItemTargeting
|
|
= NoItTargeting
|
|
| ItTargeting
|
|
{ _itTgPos :: Maybe Point2
|
|
, _itTgID :: Maybe Int
|
|
, _itTgActive :: Bool
|
|
}
|
|
|
|
makeLenses ''ItemTargeting
|
|
makeLenses ''Item
|
|
makeLenses ''ItemScroll
|
|
deriveJSON defaultOptions ''ItemScroll
|
|
deriveJSON defaultOptions ''ItemTargeting
|
|
deriveJSON defaultOptions ''Item
|