Refactor machines

This commit is contained in:
2022-07-24 20:55:44 +01:00
parent d6a94ec4bc
commit 24531b75a1
10 changed files with 110 additions and 59 deletions
+1 -18
View File
@@ -4,7 +4,6 @@ module Dodge.Placement.Instance.Terminal
, putTerminal
, simpleTermMessage
, terminalColor
, terminalSPic
, accessTerminal
) where
import Dodge.Data
@@ -48,7 +47,7 @@ putTerminal mc tm
putMessageTerminal :: Color -> Terminal -> Placement
putMessageTerminal col = putTerminal $ defaultMachine
& mcColor .~ col
& mcDraw .~ terminalSPic
& mcDraw .~ MachineDrawTerminal --terminalSPic
& mcHP .~ 100
termButton :: Button
@@ -68,22 +67,6 @@ termButton = Button
terminalColor :: Color
terminalColor = dark magenta
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
accessTerminal :: Maybe Int -> World -> World
accessTerminal mtmid w = case mtmid of