Unify block wall types

This commit is contained in:
2021-10-28 00:05:57 +01:00
parent 74e19008b4
commit 686a9fc3ee
9 changed files with 38 additions and 187 deletions
+15 -30
View File
@@ -57,7 +57,7 @@ data World = World
, _particles :: ![Particle]
, _walls :: !(IM.IntMap Wall)
, _doors :: IM.IntMap Door
, _blocks :: IM.IntMap Block'
, _blocks :: IM.IntMap Block
, _wallsZone :: Zone (IM.IntMap Wall)
, _forceFields :: IM.IntMap ForceField
, _floorItems :: IM.IntMap FloorItem
@@ -536,11 +536,11 @@ data Prop
, _pjTimer :: Int
}
data Either3 a b c = E3x1 a | E3x2 b | E3x3 c
data Block' = Block'
data Block = Block
{ _blID :: Int
, _blWallIDs :: [Int]
, _blHPs :: [Int]
, _blShadows' :: [Int]
, _blShadows :: [Int]
}
data Door = Door
{ _drID :: Int
@@ -551,32 +551,17 @@ data Door = Door
}
data DoorStatus = DoorOpen | DoorClosed | DoorHalfway | DoorInt Int
deriving (Eq, Ord, Show)
data Wall
= Wall
{ _wlLine :: (Point2,Point2)
, _wlID :: Int
, _wlColor :: Color
, _wlSeen :: Bool
, _wlIsSeeThrough :: Bool
, _wlPathable :: Bool
, _wlDraw :: Bool
, _wlRotateTo :: Bool
}
| Block
{ _wlLine :: (Point2,Point2)
, _wlID :: Int
, _wlColor :: Color
, _wlSeen :: Bool
, _blIDs :: [Int]
--, _blHP :: Int
, _wlIsSeeThrough :: Bool
, _blVisible :: Bool
--, _blDegrades :: [Int]
, _blShadows :: [Int]
, _wlDraw :: Bool
, _wlRotateTo :: Bool
, _wlBlockID :: Int
}
data Wall = Wall
{ _wlLine :: (Point2,Point2)
, _wlID :: Int
, _wlColor :: Color
, _wlSeen :: Bool
, _wlIsSeeThrough :: Bool
, _wlPathable :: Bool
, _wlDraw :: Bool
, _wlRotateTo :: Bool
, _wlBlockID :: Maybe Int
}
data ForceField = FF
{ _ffLine :: [Point2] , _ffID :: Int
, _ffColor :: Color
@@ -773,7 +758,7 @@ makeLenses ''CrGroupParams
makeLenses ''CrMvType
makeLenses ''Intention
makeLenses ''Door
makeLenses ''Block'
makeLenses ''Block
makeLenses ''Zone
numColor :: Int -> Color
numColor 0 = toV4 (1,0,0,1)