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
-1
View File
@@ -17,7 +17,6 @@ data Cloud = Cloud
, _clAlt :: Float
, _clTimer :: Int
, _clType :: CloudType
-- , _clEffect :: Cloud -> World -> World
}
deriving (Eq,Ord,Show,Read)
data CloudType
+13
View File
@@ -0,0 +1,13 @@
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE StrictData #-}
module Dodge.Data.LinearShockwave where
import Geometry.Data
import Control.Lens
data LinearShockwave = LinearShockwave
{ _lwPos :: Point2
, _lwID :: Int
, _lwPoints :: [(Point2,Point2)]
, _lwTimer :: Int
}
deriving (Eq,Ord,Show,Read)
makeLenses ''LinearShockwave
+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
+13
View File
@@ -0,0 +1,13 @@
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE StrictData #-}
module Dodge.Data.TractorBeam where
import Geometry.Data
import Control.Lens
data TractorBeam = TractorBeam
{ _tbPos :: Point2
, _tbStartPos :: Point2
, _tbVel :: Point2
, _tbTime :: Int
}
deriving (Eq,Ord,Show,Read)
makeLenses ''TractorBeam
+6 -1
View File
@@ -2,7 +2,6 @@ module Dodge.Data.WorldEffect where
import Sound.Data
import Geometry.Data
import Dodge.Data.SoundOrigin
data WorldEffect = NoWorldEffect
| SetTrigger Bool Int
| WorldEffects [WorldEffect]
@@ -21,3 +20,9 @@ data MdWdWd = MdWdId
| MdSetLSCol Point3
| MdFlickerUpdate
deriving (Eq,Ord,Show,Read)
data WdBl = WdTrig Int
| WdBlDoorMoving Int
deriving (Eq,Ord,Show,Read)
data WdP2f = WdP2f0
| WdP2fDoorPosition Int
deriving (Eq,Ord,Show,Read)