Reify block drawing

This commit is contained in:
2022-07-25 01:27:39 +01:00
parent 486c203fa2
commit c3a5b9d5be
15 changed files with 85 additions and 23 deletions
+19
View File
@@ -0,0 +1,19 @@
module Dodge.Block.Draw
where
import Shape
import Dodge.Data.Block
import ShapePicture
drawBlock :: BlockDraw -> Block -> SPic
drawBlock bd = case bd of
BlockDrawMempty -> const mempty
BlockDraws bds -> \bl -> foldMap (flip drawBlock bl) bds
BlockDrawColHeightPoss col h ps -> const $ noPic $ colorSH col (upperPrismPoly h $ ps)
BlockDrawBlSh x -> \bl -> noPic $ doBlSh x bl
doBlSh :: BlSh -> Block -> Shape
doBlSh bs = case bs of
BlShMempty -> const mempty
BlShConst sh -> const sh