Cleanup unused datatypes

This commit is contained in:
2025-08-19 18:11:31 +01:00
parent e1cfe7e163
commit 1cfb581e15
4 changed files with 4 additions and 69 deletions
-40
View File
@@ -19,10 +19,6 @@ import Dodge.Data.BlBl
import Dodge.Data.Terminal.Status
import Dodge.Data.WorldEffect
--data TerminalInput = TerminalInput
-- { _tiSel :: (Int, Int)
-- }
data Terminal = Terminal
{ _tmID :: Int
, _tmBootLines :: [TerminalLine]
@@ -51,42 +47,12 @@ data TerminalToggle = TerminalToggle
, _ttDeathEffect :: BlBl
}
data EffectArguments
= NoArguments {_cmdEffect :: [TerminalLine]}
| OneArgument
{ _argType :: String
, _argList :: M.Map String [TerminalLine]
}
data TerminalCommandEffect
= TerminalCommandArguments EffectArguments
| TerminalCommandEffectDamageCoding
| TerminalCommandEffectSensorParameter
| TerminalCommandEffectLinkedObject
| TerminalCommandEffectHelp
| TerminalCommandEffectNoArgumentsStr String
| TerminalCommandEffectCommands
| TerminalCommandEffectSingleCommand WdWd [String]
| TerminalCommandEffectNone
--data TerminalCommand = TerminalCommand
-- { _tcString :: String
-- , _tcAlias :: [String]
-- , _tcHelp :: String
-- , _tcEffect :: TerminalCommandEffect -- Terminal -> World -> EffectArguments
-- }
data TCom = TCInfo String String -- this may not be necessary, to revisit
| TCBase
| TCDamageCommand
| TCSensorInfo
| TCToggles
--data TEff = TEff
-- { _teffHelp :: String
-- , _teffArgs :: PTE.TrieMap Char [TerminalLine]
-- }
data TmWdWd
= TmWdId
| TmWdWdPowerDownTerminal
@@ -98,13 +64,10 @@ data TmWdWd
| TmTmSetStatus TerminalStatus
| TmGetDamageCoding SensorType
| TmGetSensor String
-- | TmDisplayCommands
makeLenses ''Terminal
makeLenses ''TerminalLine
makeLenses ''TerminalToggle
makeLenses ''EffectArguments
--makeLenses ''TerminalCommand
makeLenses ''TCom
concat
<$> mapM
@@ -112,9 +75,6 @@ concat
[ ''TerminalLineString
, ''TerminalLine
, ''TerminalToggle
, ''EffectArguments
, ''TerminalCommandEffect
-- , ''TerminalCommand
, ''TCom
, ''TmWdWd
, ''Terminal
+4 -1
View File
@@ -117,7 +117,10 @@ makeTermLine :: String -> TerminalLine
makeTermLine = makeColorTermLine termTextColor
tlSetStatus :: TerminalStatus -> [TerminalLine]
tlSetStatus x = [TLine 1 [] $ TmTmSetStatus x]
tlSetStatus x = tlDoEffect $ TmTmSetStatus x
tlDoEffect :: TmWdWd -> [TerminalLine]
tlDoEffect x = [TLine 1 [] x]
makeTermPara :: String -> [TerminalLine]
makeTermPara = makeColorTermPara termTextColor
-3
View File
@@ -1,3 +0,0 @@
module Dodge.TerminalCommandEffect
where
-25
View File
@@ -218,28 +218,3 @@ scrollRBOption dy ymax
| dy < 0 = min (ymax -1) . subtract dy
| dy > 0 = max 0 . subtract dy
| otherwise = id
--scrollCommands :: Terminal -> [TerminalCommand]
--scrollCommands = (nullCommand :) . _tmScrollCommands
--scrollCommandStrings :: World -> Terminal -> [String]
--scrollCommandStrings w tm = case tm ^? tmPartialCommand . _Just of
-- Nothing -> map _tcString $ scrollCommands tm
-- Just tc -> "" : map tail (getArguments tc tm w)
--getArguments' :: TerminalCommand -> Terminal -> World -> [String]
--getArguments' tc tm = ("" :) . getArguments tc tm
--nullCommand :: TerminalCommand
--nullCommand =
-- TerminalCommand
-- { _tcString = ""
-- , _tcAlias = []
-- , _tcHelp = ""
-- , _tcEffect = TerminalCommandEffectNone -- \_ _ -> NoArguments []
-- }
--getArguments :: TerminalCommand -> Terminal -> World -> [String]
--getArguments tc tm w = case doTerminalCommandEffect (_tcEffect tc) tm w of
-- NoArguments{} -> []
-- OneArgument _ m -> map (' ' :) $ M.keys m