18 lines
516 B
Haskell
18 lines
516 B
Haskell
module Dodge.Block.Draw (drawBlock) where
|
|
|
|
import Dodge.Data.Block
|
|
import Shape
|
|
import ShapePicture
|
|
|
|
drawBlock :: BlockDraw -> Block -> SPic
|
|
drawBlock bd = case bd of
|
|
BlockDrawMempty -> const mempty
|
|
BlockDraws bds -> \bl -> foldMap (`drawBlock` bl) bds
|
|
BlockDrawColHeightPoss col h ps -> const $ noPic $ colorSH col (upperBox Medium Typical h ps)
|
|
BlockDrawBlSh x -> noPic . doBlSh x
|
|
|
|
doBlSh :: BlSh -> Block -> Shape
|
|
doBlSh bs = case bs of
|
|
BlShMempty -> const mempty
|
|
BlShConst sh -> const sh
|