Remove _plGenUpdate field, instead allow Placements to take World arg

This commit is contained in:
2022-06-02 20:00:03 +01:00
parent 7c4a853d70
commit 024f72da20
13 changed files with 54 additions and 53 deletions
+3 -6
View File
@@ -35,7 +35,9 @@ putTerminal' col mcf = ps0PushPS (PutButton termButton)
$ const Nothing
putTerminal :: (GenParams -> World -> TerminalParams) -> Placement
putTerminal f = plGenUpdate ?~ g $ ps0PushPS (PutButton termButton)
putTerminal f = ps0PushPSw PutNothing $ \w _ -> Just $
--plGenUpdate ?~ g $ ps0PushPS (PutButton $ termButton & btTerminalParams .~ f (_genParams w))
ps0PushPS (PutButton $ termButton & btTerminalParams .~ f (_genParams w))
$ \pl -> Just $ pt0 (PutMachine terminalColor (reverse $ square 10) defaultMachine
{ _mcDraw = noPic . terminalShape terminalColor
, _mcHP = 100
@@ -44,11 +46,6 @@ putTerminal f = plGenUpdate ?~ g $ ps0PushPS (PutButton termButton)
. makeExplosionAt (_mcPos mc)
})
$ const Nothing
where
g gp pl = (gp,
pl & plType . putButton . btTerminalParams .~ f gp
& plGenUpdate .~ Nothing
)
termButton :: Button
termButton = Button
{ _btPict = const mempty