Simplify and unify block placement

This commit is contained in:
jgk
2021-03-27 02:18:37 +01:00
parent 32376022cc
commit 151fa5b6bd
8 changed files with 198 additions and 187 deletions
+58
View File
@@ -0,0 +1,58 @@
module Dodge.Room.Placement
where
import Dodge.Data
import Picture
import Geometry
-- module defining helper placements for rooms
singleBlock :: Point2 -> [PlacementSpot]
singleBlock a = [PS a 0 $ PutBlock [5,20,20] (greyN 0.5)
$ reverse $ rectNSWE 10 (-10) (-10) 10]
blockLine :: Point2 -> Point2 -> PlacementSpot
blockLine a b = PS
{ _psPos = (0,0)
, _psRot = 0
, _psType = PutLineBlock baseBlockPane 9 9 a b
}
windowLine :: Point2 -> Point2 -> PlacementSpot
windowLine a b = PS
{ _psPos = (0,0)
, _psRot = 0
, _psType = PutLineBlock baseWindowPane 8 8 a b
}
windowLineType :: Point2 -> Point2 -> PSType
windowLineType a b = PutLineBlock baseWindowPane 8 8 a b
baseBlockPane :: Wall
baseBlockPane = Block
{ _wlLine = []
, _wlID = 0
, _wlColor = greyN 0.5
, _wlDraw = Nothing
, _wlSeen = False
, _blIDs = []
, _blHP = 5
, _wlIsSeeThrough = False
, _blVisible = True
, _blShadows = []
, _blDegrades = [20,20]
}
baseWindowPane :: Wall
baseWindowPane = Block
{ _wlLine = []
, _wlID = 0
, _wlColor = withAlpha 0.2 cyan
, _wlDraw = Nothing
, _wlSeen = False
, _blIDs = []
, _blHP = 1
, _wlIsSeeThrough = True
, _blVisible = True
, _blShadows = []
, _blDegrades = [5,5]
}