Files
loop/src/Dodge/Data/Cloud.hs
T
2026-04-23 10:30:43 +01:00

60 lines
1.3 KiB
Haskell

{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
module Dodge.Data.Cloud where
import Dodge.Data.Material
import Control.Lens
import Data.Aeson
import Data.Aeson.TH
import Geometry
data Cloud = Cloud
{ _clPos :: Point3
, _clVel :: Point3
, _clTimer :: Int
, _clType :: CloudType
}
deriving (Eq, Ord, Show, Read) --Generic, Flat)
data CloudType
= Smoke
| RocketSmoke
| CryoReleaseCloud
deriving (Eq, Ord, Show, Read) --Generic, Flat)
data Dust = Dust
{ _dsPos :: Point3
, _dsVel :: Point3
, _dsTimer :: Int
, _dsType :: Material
}
deriving (Eq, Ord, Show, Read) --Generic, Flat)
data Gas = Gas
{ _gsPos :: Point3
, _gsVel :: Point3
, _gsTimer :: Int
, _gsType :: GasType
}
deriving (Eq, Ord, Show, Read) --Generic, Flat)
data GasType = PoisonGas
deriving (Eq, Ord, Show, Read) --Generic, Flat)
data BeePheremone = BPheremone
{ _bpPos :: Point2
, _bpTimer :: Int
}
makeLenses ''Cloud
makeLenses ''BeePheremone
deriveJSON defaultOptions ''CloudType
deriveJSON defaultOptions ''Cloud
deriveJSON defaultOptions ''BeePheremone
makeLenses ''Dust
deriveJSON defaultOptions ''Dust
makeLenses ''Gas
deriveJSON defaultOptions ''GasType
deriveJSON defaultOptions ''Gas