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
+29 -3
View File
@@ -1,11 +1,37 @@
--{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE StrictData #-}
module Dodge.Data.Door where
import Dodge.Data.PathGraph
import Dodge.Data.MountedObject
import Geometry.Data
import Dodge.Data.WorldEffect
import qualified Data.IntSet as IS
import Control.Lens
data DoorStatus = DoorOpen | DoorClosed | DoorHalfway | DoorInt Int
deriving (Eq, Ord, Show)
deriving (Eq, Ord, Show,Read)
data PushSource = PushesItself
| PushedBy Int
| NotPushed
deriving (Eq,Ord,Show)
deriving (Eq,Ord,Show,Read)
data Door = Door
{ _drID :: Int
, _drWallIDs :: IS.IntSet
, _drStatus :: DoorStatus
, _drTrigger :: WdBl
, _drMech :: DrWdWd
, _drPos :: (Point2,Point2)
, _drOpenPos :: (Point2,Point2)
, _drClosePos :: (Point2,Point2)
, _drHP :: Int
, _drDeath :: DrWdWd
, _drSpeed :: Float
, _drPushedBy :: PushSource
, _drPushes :: Maybe Int
, _drMounts :: [MountedObject]
, _drObstructs :: [(Int,Int,PathEdge)]
, _drObstacleType :: EdgeObstacle
}
deriving (Eq,Ord,Show,Read)
makeLenses ''Door