Refactor projectiles

This commit is contained in:
2022-07-20 09:55:07 +01:00
parent 9daf872878
commit 330a81a955
14 changed files with 196 additions and 200 deletions
+35 -32
View File
@@ -159,6 +159,7 @@ data World = World
, _gusts :: IM.IntMap Gust
, _gsZoning :: Zoning IM.IntMap Gust
, _props :: IM.IntMap Prop
, _projectiles :: IM.IntMap Proj
, _instantBullets :: [Bullet]
, _bullets :: [Bullet]
, _instantParticles :: [Particle]
@@ -718,16 +719,40 @@ data Modification
, _mdExternalID2 :: Int
, _mdUpdate :: Modification -> World -> World
}
data Prop
= Projectile
{ _prPos :: Point2
, _pjStartPos :: Point2
, _pjVel :: Point2
, _prDraw :: Prop -> SPic
, _pjID :: Int
, _pjUpdate :: Prop -> World -> World
data Proj
= RemoteShell
{ _prjPos :: Point2
, _prjStartPos :: Point2
, _prjVel :: Point2
, _prjDraw :: ProjectileDraw
, _prjID :: Int
, _prjUpdate :: Proj -> World -> World
, _prjPayload :: Payload
}
| PropZ
| Shell
{ _prjPos :: Point2
, _prjStartPos :: Point2
, _prjVel :: Point2
, _prjAcc :: Point2
, _prjDir :: Float
, _prjSpin :: Float
, _prjDraw :: ProjectileDraw
, _prjID :: Int
, _prjUpdate :: Proj -> World -> World
, _prjPayload :: Payload
, _prjTimer :: Int
, _prjZ :: Float
}
data Prop
-- = Projectile
-- { _prPos :: Point2
-- , _pjStartPos :: Point2
-- , _pjVel :: Point2
-- , _prDraw :: Prop -> SPic
-- , _pjID :: Int
-- , _pjUpdate :: Prop -> World -> World
-- }
= PropZ
{ _prPos :: Point2
, _pjStartPos :: Point2
, _pjVel :: Point2
@@ -773,29 +798,6 @@ data Prop
, _prDraw :: Prop -> SPic
, _prToggle :: Bool
}
| RemoteShell
{ _prPos :: Point2
, _pjStartPos :: Point2
, _pjVel :: Point2
, _prDraw :: Prop -> SPic
, _pjID :: Int
, _pjUpdate :: Prop -> World -> World
, _pjPayload :: Point2 -> World -> World
}
| Shell
{ _prPos :: Point2
, _pjStartPos :: Point2
, _pjVel :: Point2
, _pjAcc :: Point2
, _pjDir :: Float
, _pjSpin :: Float
, _prDraw :: Prop -> SPic
, _pjID :: Int
, _pjUpdate :: Prop -> World -> World
, _pjPayload :: Point2 -> World -> World
, _pjTimer :: Int
, _pjZ :: Float
}
| Bomb
{ _prPos :: Point2
, _pjVel :: Point2
@@ -1307,6 +1309,7 @@ makeLenses ''ItemConsumption
makeLenses ''AmmoType
makeLenses ''TweakParam
makeLenses ''Prop
makeLenses ''Proj
makeLenses ''Modification
makeLenses ''Particle
makeLenses ''PressPlate