80 lines
2.0 KiB
Haskell
80 lines
2.0 KiB
Haskell
{-# LANGUAGE DeriveGeneric #-}
|
|
{-# LANGUAGE DeriveAnyClass #-}
|
|
{-# LANGUAGE StrictData #-}
|
|
{-# LANGUAGE TemplateHaskell #-}
|
|
|
|
module Dodge.Data.Prop where
|
|
|
|
import Color
|
|
import Control.Lens
|
|
import Data.Aeson
|
|
import Data.Aeson.TH
|
|
import Dodge.Data.WorldEffect
|
|
import Geometry.Data
|
|
import qualified Quaternion as Q
|
|
import Shape.Data
|
|
import ShapePicture.Data
|
|
|
|
data Prop
|
|
= PropZ
|
|
{ _prPos :: Point2
|
|
, _prDraw :: PropDraw
|
|
, _prUpdate :: PropUpdate
|
|
, _prStartPos :: Point2
|
|
, _prVel :: Point2
|
|
, _prID :: Int
|
|
, _prPosZ :: Float
|
|
, _prVelZ :: Float
|
|
, _prTimer :: Int
|
|
, _prQuat :: Q.Quaternion Float
|
|
, _prQuatSpin :: Q.Quaternion Float
|
|
, _prColor :: Color
|
|
}
|
|
| ShapeProp
|
|
{ _prPos :: Point2
|
|
, _prDraw :: PropDraw
|
|
, _prUpdate :: PropUpdate
|
|
, _prID :: Int
|
|
, _prRot :: Float
|
|
, _prToggle :: Bool
|
|
}
|
|
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
|
|
data PropDraw
|
|
= PropDrawSPic SPic
|
|
| PropDrawMovingShapeCol Shape
|
|
| PropDrawMovingShape PropDraw
|
|
| PropDrawFlatTranslate PropDraw
|
|
| PropDoubleLampCover Float
|
|
| PropVerticalLampCover Float
|
|
| PropLampCover Float
|
|
| PropDrawToggle PropDraw
|
|
| PropDrawGib Float
|
|
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
|
|
data PropUpdate
|
|
= PropUpdateAnd PropUpdate PropUpdate
|
|
| PropFallSmallBounceDamage
|
|
| PropFallSmallBounce
|
|
| PropUpdateId
|
|
| PropRotate Float
|
|
| PropSetToggleAnd WdBl PropUpdate
|
|
| PropUpdates [PropUpdate]
|
|
| PropUpdateLS Int PrWdLsLs
|
|
| PropUpdatePosition WdP2f
|
|
| PropUpdateWhen WdBl PropUpdate
|
|
| PropUpdateIf WdBl PropUpdate PropUpdate
|
|
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
|
|
data PrWdLsLs
|
|
= PrWdLsId
|
|
| PrWdLsSetPosition WdP2f Point3
|
|
| PrWdLsSetColor Point3
|
|
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
|
|
makeLenses ''Prop
|
|
deriveJSON defaultOptions ''PropDraw
|
|
deriveJSON defaultOptions ''PrWdLsLs
|
|
deriveJSON defaultOptions ''PropUpdate
|
|
deriveJSON defaultOptions ''Prop
|