Cleanup, merge modules
This commit is contained in:
@@ -3,18 +3,22 @@
|
||||
{-# LANGUAGE StrictData #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
module Dodge.Data.Machine.Sensor (
|
||||
module Dodge.Data.Machine.Sensor,
|
||||
module Dodge.Data.Machine.Sensor.Type,
|
||||
) where
|
||||
module Dodge.Data.Machine.Sensor (module Dodge.Data.Machine.Sensor) where
|
||||
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import Dodge.Data.Item.Combine
|
||||
import Dodge.Data.Machine.Sensor.Type
|
||||
import Geometry.Data
|
||||
|
||||
data SensorType
|
||||
= LaserSensor
|
||||
| ElectricSensor
|
||||
| ThermalSensor
|
||||
| PhysicalSensor
|
||||
deriving (Eq, Ord, Show, Read, Bounded, Enum)
|
||||
|
||||
|
||||
data DamageSensor = DamSensor
|
||||
{ _sensAmount :: Int
|
||||
, _sensType :: SensorType
|
||||
@@ -22,19 +26,29 @@ data DamageSensor = DamSensor
|
||||
}
|
||||
|
||||
data ProximitySensor = ProxSensor
|
||||
{ _proxRequirement :: ProximityRequirement
|
||||
{ _proxSensorType :: ProximitySensorType
|
||||
, _proxToggle :: Bool
|
||||
}
|
||||
|
||||
data ProximitySensorType
|
||||
= SensorWithRequirement ProximityRequirement
|
||||
| NoItemZone [Point2]
|
||||
|
||||
data ProximityRequirement
|
||||
= RequireHealth {_proxReqMinHealth :: Int}
|
||||
| RequireEquipment {_proxReqEquipment :: ItemType}
|
||||
| RequireNoItems {_proxNoItems :: [Point2]}
|
||||
deriving (Show)
|
||||
|
||||
makeLenses ''DamageSensor
|
||||
makeLenses ''ProximitySensor
|
||||
makeLenses ''ProximityRequirement
|
||||
makeLenses ''ProximitySensorType
|
||||
makePrisms ''ProximityRequirement
|
||||
deriveJSON defaultOptions ''SensorType
|
||||
deriveJSON defaultOptions ''ProximityRequirement
|
||||
deriveJSON defaultOptions ''ProximitySensorType
|
||||
deriveJSON defaultOptions ''ProximitySensor
|
||||
deriveJSON defaultOptions ''DamageSensor
|
||||
|
||||
instance ToJSONKey SensorType
|
||||
|
||||
instance FromJSONKey SensorType
|
||||
|
||||
Reference in New Issue
Block a user