Move GenWorld update of placements into product type
This commit is contained in:
@@ -17,7 +17,7 @@ import Shape
|
||||
import Data.Maybe
|
||||
|
||||
putTerminal :: (GenParams -> TerminalParams) -> Placement
|
||||
putTerminal f = PlacementGenUpdate g $ ps0PushPS (PutButton thebutton)
|
||||
putTerminal f = plGenUpdate ?~ g $ ps0PushPS (PutButton thebutton)
|
||||
$ \pl -> Just $ pt0 (PutMachine terminalColor (reverse $ square 10) defaultMachine
|
||||
{ _mcDraw = drawTerminal
|
||||
, _mcHP = 100
|
||||
@@ -27,7 +27,9 @@ putTerminal f = PlacementGenUpdate g $ ps0PushPS (PutButton thebutton)
|
||||
})
|
||||
$ const Nothing
|
||||
where
|
||||
g gp pl = (gp, pl & plType . pstPutButton . btTerminalParams .~ f gp)
|
||||
g gp pl = (gp, pl & plType . pstPutButton . btTerminalParams .~ f gp
|
||||
& plGenUpdate .~ Nothing
|
||||
)
|
||||
thebutton = Button
|
||||
{ _btPict = const mempty
|
||||
, _btPos = 0
|
||||
|
||||
Reference in New Issue
Block a user