Cleanup, merge modules

This commit is contained in:
2025-09-18 08:28:09 +01:00
parent f12ae3533c
commit 1564b1c721
23 changed files with 166 additions and 540 deletions
+21 -21
View File
@@ -1,17 +1,17 @@
module Dodge.Machine.Draw (drawMachine) where
import Dodge.Data.CWorld
import Dodge.Terminal.Color
import Control.Lens
import qualified Data.Map.Strict as M
import Data.Maybe
import Dodge.Data.CWorld
import Dodge.Item.Draw.SPic
import Dodge.Item.HeldOffset
import Dodge.Placement.TopDecoration
import Dodge.Terminal.Color
import Geometry
import Picture
import Shape
import ShapePicture
import qualified Data.Map.Strict as M
drawMachine :: CWorld -> Machine -> SPic
drawMachine cw mc = case _mcType mc of
@@ -24,18 +24,18 @@ drawMachine cw mc = case _mcType mc of
lw = cw ^. lWorld
gp = cw ^. cwGen . cwgParams . sensorCoding
drawDamSensor :: M.Map SensorType (PaletteColor, DecorationShape)
-> DamageSensor -> Machine -> SPic
drawDamSensor gp sens mc = --case sens of
--DamSensor{_sensDraw = pcds} -> sensorSPic pcds
fold $ do
let st = sens ^. sensType
x <- gp ^? ix st
return $ sensorSPic x mc
drawDamSensor ::
M.Map SensorType (PaletteColor, DecorationShape) ->
DamageSensor ->
Machine ->
SPic
drawDamSensor gp sens mc = fold $ do
let st = sens ^. sensType
x <- gp ^? ix st
return $ sensorSPic x mc
drawProxSensor :: ProximitySensor -> Machine -> SPic
drawProxSensor sens = case sens of
ProxSensor{} -> const mempty
drawProxSensor _ = const mempty
terminalSPic :: LWorld -> Machine -> SPic
terminalSPic lw = noPic . terminalShape lw
@@ -56,14 +56,14 @@ terminalShape lw mc = fromMaybe mempty $ do
<> screenbackground (getcol term)
where
getcol term = fromMaybe black $ termScreenColor term
screenbackground col = colorSH
col
( prismBox
Small
Typical
[V3 8 8 20, V3 (-8) 8 20, V3 0 (-8) 10]
[V3 8 8 19, V3 (-8) 8 19, V3 0 (-8) 9]
)
screenbackground col =
colorSH
col
$ prismBox
Small
Typical
[V3 8 8 20, V3 (-8) 8 20, V3 0 (-8) 10]
[V3 8 8 19, V3 (-8) 8 19, V3 0 (-8) 9]
drawBaseMachine :: Float -> Machine -> SPic
drawBaseMachine h mc =