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
+9 -70
View File
@@ -80,7 +80,13 @@ module Dodge.Data
, module Dodge.Data.Laser
, module Dodge.Data.TeslaArc
, module Dodge.Data.Shockwave
, module Dodge.Data.Prop
, module Dodge.Data.LinearShockwave
, module Dodge.Data.TractorBeam
) where
import Dodge.Data.TractorBeam
import Dodge.Data.LinearShockwave
import Dodge.Data.Prop
import Dodge.Data.Shockwave
import Dodge.Data.TeslaArc
import Dodge.Data.Laser
@@ -161,10 +167,7 @@ import Dodge.GameRoom
import Color
import Data.Tile
import MaybeHelp
--import StreamingHelp.Data
--import qualified Data.Vector as V
import qualified Linear.Quaternion as Q
import Control.Lens
import Control.Monad.State
import System.Random
@@ -230,6 +233,8 @@ data World = World
, _shockwaves :: [Shockwave]
, _lasers :: [LaserStart]
, _lasersToDraw :: [Laser]
, _linearShockwaves :: IM.IntMap LinearShockwave
, _tractorBeams :: [TractorBeam]
, _walls :: IM.IntMap Wall
, _wallDamages :: IM.IntMap [Damage]
, _doors :: IM.IntMap Door
@@ -287,6 +292,7 @@ data World = World
, _lSelect :: Point2
, _rSelect :: Point2
}
--deriving (Eq,Ord,Show,Read)
data WorldHammer
= SubInvHam
| DoubleMouseHam
@@ -396,72 +402,6 @@ type HitEffect' = Flame
-> World
-> (World,Maybe Flame)
data Prop
= PropZ
{ _prPos :: Point2
, _pjStartPos :: Point2
, _pjVel :: Point2
, _prDraw :: Prop -> SPic
, _pjID :: Int
, _pjUpdate :: Prop -> World -> World
, _pjPosZ :: Float
, _pjVelZ :: Float
, _pjTimer :: Int
, _pjQuat :: Q.Quaternion Float
, _pjQuatSpin :: Q.Quaternion Float
, _pjColor :: Color
}
| Drone
{ _prPos :: Point2
, _pjStartPos :: Point2
, _pjVel :: Point2
, _prDraw :: Prop -> SPic
, _pjID :: Int
, _pjUpdate :: Prop -> World -> World
}
| RecursiveProp
{ _prPos :: Point2
, _pjID :: Int
, _pjDraw :: Prop -> SPic
, _pjUpdate :: Prop -> World -> World
, _pjProp :: Prop
}
| ProjectileTimed
{ _prPos :: Point2
, _pjStartPos :: Point2
, _pjVel :: Point2
, _prDraw :: Prop -> SPic
, _pjID :: Int
, _pjUpdate :: Prop -> World -> World
, _pjTime :: Int
}
| ShapeProp
{ _prPos :: Point2
, _pjID :: Int
, _pjRot :: Float
, _pjUpdate :: Prop -> World -> World
, _prDraw :: Prop -> SPic
, _prToggle :: Bool
}
| Bomb
{ _prPos :: Point2
, _pjVel :: Point2
, _pjZ :: Float
, _pjVelZ :: Float
, _prDraw :: Prop -> SPic
, _pjID :: Int
, _pjUpdate :: Prop -> World -> World
, _pjPayload :: Point2 -> World -> World
, _pjTimer :: Int
}
| LinearShockwave
{ _prDraw :: Prop -> SPic
, _prPos :: Point2
, _pjID :: Int
, _pjUpdate :: Prop -> World -> World
, _pjPoints :: [(Point2,Point2)]
, _pjTimer :: Int
}
data Either3 a b c = E3x1 a | E3x2 b | E3x3 c
data TerminalStatus = TerminalOff | TerminalBusy | TerminalReady
deriving (Eq,Ord,Show)
@@ -653,7 +593,6 @@ data InPlacement = InPlacement
}
makeLenses ''World
makeLenses ''FloorItem
makeLenses ''Prop
makeLenses ''Particle
makeLenses ''Door
makeLenses ''Terminal