This commit is contained in:
2023-05-01 22:35:33 +01:00
parent 7b8b8750a9
commit 61f88aeb4a
9 changed files with 120 additions and 121 deletions
+6 -13
View File
@@ -1,4 +1,9 @@
module Dodge.WorldEffect where
module Dodge.WorldEffect
( doWdWd
, accessTerminal
, doTmWdWd
, lineOutputTerminal
) where
import Data.Foldable
import qualified Data.Map.Strict as M
@@ -63,17 +68,6 @@ torqueCr x cid w
where
(rot, g) = randomR (- x, x) $ _randGen w
doCommandInstant :: String -> Terminal -> World -> World
doCommandInstant arg tm w = doLineEffectsInstant tm w $ commandFutureLines arg tm w
-- doesn't do internal terminal effects
doLineEffectsInstant :: Terminal -> World -> [TerminalLine] -> World
doLineEffectsInstant tm = foldr f
where
f tl w = case tl of
TerminalLineEffect _ eff -> doTmWdWd eff tm w
_ -> w
lineOutputTerminal :: [TerminalLine] -> Terminal
lineOutputTerminal tls =
defaultTerminal
@@ -81,7 +75,6 @@ lineOutputTerminal tls =
, _tmFutureLines = []
, _tmMaxLines = 14
, _tmTitle = "TERMINAL"
, _tmInput = defaultTerminalInput
, _tmScrollCommands = [quitCommand]
, _tmWriteCommands = [helpCommand, commandsCommand]
, _tmBootProgram = TerminalBootLines $ connectionBlurbLines tls