Prop reification/splitting

This commit is contained in:
2022-07-24 13:45:05 +01:00
parent 5a2f529182
commit ac069d08f6
31 changed files with 585 additions and 458 deletions
+65
View File
@@ -0,0 +1,65 @@
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE StrictData #-}
module Dodge.Data.Prop
where
import Dodge.Data.WorldEffect
import Shape.Data
import Color
import qualified Linear.Quaternion as Q
import Geometry.Data
import ShapePicture.Data
import Control.Lens
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)
data PropUpdate -- = UpdatePropZ
= PropUpdateAnd PropUpdate PropUpdate
-- | UpdateShapeProp
| PropFallSmallBounceDamage
| PropFallSmallBounce
| PropUpdateId
| PropRotate Float
| PropSetToggleAnd WdBl PropUpdate
| PropUpdates [PropUpdate]
| PropUpdateLS Int PrWdLsLs -- Prop -> World -> LightSource -> LightSource
| PropUpdatePosition WdP2f
| PropUpdateWhen WdBl PropUpdate
| PropUpdateIf WdBl PropUpdate PropUpdate
deriving (Eq,Ord,Show,Read)
data PrWdLsLs = PrWdLsId
| PrWdLsSetPosition WdP2f Point3
| PrWdLsSetColor Point3
deriving (Eq,Ord,Show,Read)
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)
makeLenses ''Prop