Reify block drawing
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user