Simplify block drawing further, store shape of block

This commit is contained in:
2025-10-24 19:39:44 +01:00
parent ffea3a1694
commit 95b4105f52
9 changed files with 143 additions and 163 deletions
+12 -11
View File
@@ -1,12 +1,13 @@
module Dodge.Block.Draw (drawBlock) where
--{-# LANGUAGE LambdaCase #-}
module Dodge.Block.Draw () where
--
--import Dodge.Data.Block
--import Shape
--import ShapePicture
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 -> const $ noPic x
--drawBlock :: BlockDraw -> SPic
--drawBlock = \case
-- BlockDrawMempty -> mempty
---- BlockDraws bds -> foldMap drawBlock bds
---- BlockDrawColHeightPoss col h ps -> noPic $ colorSH col (upperBox Medium Typical h ps)
-- BlockDrawBlSh x -> noPic x