Refactor doors
This commit is contained in:
+13
-1
@@ -59,6 +59,7 @@ data World = World
|
||||
, _props :: IM.IntMap Prop
|
||||
, _particles :: ![Particle]
|
||||
, _walls :: !(IM.IntMap Wall)
|
||||
, _doors :: IM.IntMap Door'
|
||||
, _wallsZone :: Zone (IM.IntMap Wall)
|
||||
, _forceFields :: IM.IntMap ForceField
|
||||
, _floorItems :: IM.IntMap FloorItem
|
||||
@@ -237,6 +238,7 @@ data CrMvType
|
||||
}
|
||||
data WorldState
|
||||
= DoorNumOpen Int
|
||||
| DoorNumOpening Int
|
||||
| CrNumAlive Int
|
||||
deriving (Eq,Ord)
|
||||
data Button = Button
|
||||
@@ -529,7 +531,15 @@ data Prop
|
||||
, _pjTimer :: Int
|
||||
}
|
||||
data Either3 a b c = E3x1 a | E3x2 b | E3x3 c
|
||||
|
||||
data Door' = Door'
|
||||
{ _drID :: Int
|
||||
, _drWallIDs :: [Int]
|
||||
, _drStatus :: DoorStatus
|
||||
, _drTrigger :: World -> Bool
|
||||
, _drMech :: Door' -> World -> World
|
||||
}
|
||||
data DoorStatus = DoorOpen | DoorClosed | DoorHalfway
|
||||
deriving (Eq, Ord, Show)
|
||||
data Wall
|
||||
= Wall
|
||||
{ _wlLine :: (Point2,Point2)
|
||||
@@ -537,6 +547,7 @@ data Wall
|
||||
, _wlColor :: Color
|
||||
, _wlSeen :: Bool
|
||||
, _wlIsSeeThrough :: Bool
|
||||
, _wlPathable :: Bool
|
||||
}
|
||||
| BlockAutoDoor
|
||||
{ _wlLine :: (Point2,Point2)
|
||||
@@ -761,6 +772,7 @@ makeLenses ''Action
|
||||
makeLenses ''CrGroupParams
|
||||
makeLenses ''CrMvType
|
||||
makeLenses ''Intention
|
||||
makeLenses ''Door'
|
||||
numColor :: Int -> Color
|
||||
numColor 0 = toV4 (1,0,0,1)
|
||||
numColor 1 = toV4 (0,1,0,1)
|
||||
|
||||
Reference in New Issue
Block a user