Refactor machines
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
module Dodge.Machine.Draw
|
||||
where
|
||||
import Dodge.Placement.Instance.Sensor
|
||||
import Dodge.Placement.Instance.Turret
|
||||
import Shape
|
||||
import Picture
|
||||
import Geometry
|
||||
import Dodge.Data.Machine
|
||||
import ShapePicture
|
||||
|
||||
drawMachine :: MachineDraw -> Machine -> SPic
|
||||
drawMachine md = case md of
|
||||
MachineDrawMempty -> const mempty
|
||||
MachineDrawTerminal -> terminalSPic
|
||||
MachineDrawTurret -> drawTurret
|
||||
MachineDrawDamageSensor w pcds -> sensorSPic w pcds
|
||||
terminalSPic :: Machine -> SPic
|
||||
terminalSPic = noPic . terminalShape
|
||||
|
||||
terminalShape :: Machine -> Shape
|
||||
terminalShape mc = colorSH col (prismPoly
|
||||
[V3 10 10 20, V3 (-10) 10 20, V3 (-10) (-10) 10, V3 10 (-10) 10]
|
||||
[V3 10 10 0, V3 (-10) 10 0, V3 (-10) (-10) 0, V3 10 (-10) 0]
|
||||
)
|
||||
<> colorSH black (prismPoly
|
||||
[V3 8 8 20, V3 (-8) 8 20, V3 0 (-8) 10]
|
||||
[V3 8 8 19, V3 (-8) 8 19, V3 0 (-8) 9]
|
||||
--[V3 8 8 20, V3 (-8) 8 20, V3 (-8) (-8) 10, V3 8 (-8) 10]
|
||||
--[V3 8 8 19, V3 (-8) 8 19, V3 (-8) (-8) 9, V3 8 (-8) 9]
|
||||
)
|
||||
where
|
||||
col = _mcColor mc
|
||||
|
||||
Reference in New Issue
Block a user