Refactor doors

This commit is contained in:
2022-07-24 20:36:27 +01:00
parent 2c1bc67a51
commit d6a94ec4bc
25 changed files with 186 additions and 135 deletions
+4 -25
View File
@@ -83,7 +83,9 @@ module Dodge.Data
, module Dodge.Data.Prop
, module Dodge.Data.LinearShockwave
, module Dodge.Data.TractorBeam
, module Dodge.Data.MountedObject
) where
import Dodge.Data.MountedObject
import Dodge.Data.TractorBeam
import Dodge.Data.LinearShockwave
import Dodge.Data.Prop
@@ -292,7 +294,7 @@ data World = World
, _lSelect :: Point2
, _rSelect :: Point2
}
-- deriving (Eq,Ord,Show,Read)
--deriving (Eq,Ord,Show,Read)
data WorldHammer
= SubInvHam
| DoubleMouseHam
@@ -456,28 +458,6 @@ data MachineType
, _tuFireTime :: Int
, _tuMCrID :: Maybe Int
}
data Door = Door
{ _drID :: Int
, _drWallIDs :: IS.IntSet
, _drStatus :: DoorStatus
, _drTrigger :: World -> Bool
, _drMech :: Door -> World -> World
, _drPos :: (Point2,Point2)
, _drOpenPos :: (Point2,Point2)
, _drClosePos :: (Point2,Point2)
, _drHP :: Int
, _drDeath :: Door -> World -> World
, _drSpeed :: Float
, _drPushedBy :: PushSource
, _drPushes :: Maybe Int
, _drMounts :: [MountedObject]
, _drObstructs :: [(Int,Int,PathEdge)]
, _drObstacleType :: EdgeObstacle
}
data MountedObject
= MountedLS Int
| MountedProp Int
deriving (Eq,Ord,Show)
data EffectArguments
= NoArguments {_cmdEffect :: [TerminalLine]}
@@ -510,7 +490,7 @@ data PSType = PutCrit {_unPutCrit :: Creature}
, _putStartPoint :: Point2, _putEndPoint :: Point2}
| PutWall { _pwPoly :: [Point2] , _pwWall :: Wall }
| PutSlideDr Door Wall EdgeObstacle Float Point2 Point2
| PutDoor Color EdgeObstacle (World -> Bool) [(Point2,Point2)]
| PutDoor Color EdgeObstacle WdBl [(Point2,Point2)]
| RandPS (State StdGen PSType)
| PutForeground ForegroundShape
| PutDecoration Picture
@@ -594,7 +574,6 @@ data InPlacement = InPlacement
makeLenses ''World
makeLenses ''FloorItem
--makeLenses ''Particle
makeLenses ''Door
makeLenses ''Terminal
makeLenses ''Machine
makeLenses ''MachineType