35 lines
901 B
Haskell
35 lines
901 B
Haskell
{-# LANGUAGE DeriveGeneric #-}
|
|
{-# LANGUAGE DeriveAnyClass #-}
|
|
{-# LANGUAGE StrictData #-}
|
|
{-# LANGUAGE TemplateHaskell #-}
|
|
|
|
module Dodge.Data.Item.Targeting where
|
|
|
|
import Control.Lens
|
|
import Data.Aeson
|
|
import Data.Aeson.TH
|
|
import Geometry.Data
|
|
|
|
data Targeting
|
|
= NoTargeting
|
|
| Targeting
|
|
{ _tgPos :: Maybe Point2
|
|
, _tgType :: TargetType --Item -> Creature -> World -> Targeting -> (World, Targeting)
|
|
-- , _tgDraw :: TargetDraw --Item -> Creature -> Configuration -> World -> Picture
|
|
, _tgID :: Maybe Int
|
|
, _tgActive :: Bool
|
|
}
|
|
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
|
|
data TargetType
|
|
= TargetLaser
|
|
| TargetRBPress
|
|
| TargetRBLine
|
|
| TargetRBCreature
|
|
| TargetCursor
|
|
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
|
|
makeLenses ''Targeting
|
|
deriveJSON defaultOptions ''TargetType
|
|
deriveJSON defaultOptions ''Targeting
|