Simplify terminals, move towards using tries for commands
This commit is contained in:
+9
-8
@@ -497,22 +497,23 @@ zoneClouds w = w & clZoning .~ foldl' (flip zoneCloud) mempty (w ^. cWorld . lWo
|
||||
zoneDusts :: World -> World
|
||||
zoneDusts w = w & dsZoning .~ foldl' (flip zoneDust) mempty (w ^. cWorld . lWorld . dusts)
|
||||
|
||||
displayTerminalLineString :: TerminalLineString -> World -> (String, Color)
|
||||
displayTerminalLineString (TerminalLineConst str col) = const (str, col)
|
||||
displayTerminalLineString :: TerminalLineString -> (String, Color)
|
||||
displayTerminalLineString (TerminalLineConst str col) = (str, col)
|
||||
|
||||
tmUpdate :: Terminal -> World -> World
|
||||
tmUpdate tm w = case w ^? cWorld . lWorld . terminals . ix (_tmID tm) . tmFutureLines . ix 0 of
|
||||
Nothing -> w
|
||||
Just tl | _tlPause tl > 0 -> w & pointTermParams . tmFutureLines . ix 0 . tlPause -~ 1
|
||||
Just (TerminalLineDisplay _ f) ->
|
||||
Just (TLine _ tls g) ->
|
||||
w & pointTermParams
|
||||
%~ ( (tmFutureLines %~ tail)
|
||||
. (tmDisplayedLines .:~ displayTerminalLineString f w)
|
||||
. (tmDisplayedLines %~ (map displayTerminalLineString tls ++))
|
||||
)
|
||||
Just (TerminalLineEffect _ eff) ->
|
||||
w
|
||||
& pointTermParams . tmFutureLines %~ tail
|
||||
& doTmWdWd eff tm
|
||||
& doTmWdWd g tm
|
||||
-- Just (TerminalLineEffect _ eff) ->
|
||||
-- w
|
||||
-- & pointTermParams . tmFutureLines %~ tail
|
||||
-- & doTmWdWd eff tm
|
||||
where
|
||||
pointTermParams = cWorld . lWorld . terminals . ix (_tmID tm)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user