Commit before simplifying terminal commands

This commit is contained in:
2022-06-07 11:40:59 +01:00
parent 19852119ab
commit 3c2f0cb824
2 changed files with 6 additions and 2 deletions
+3
View File
@@ -48,6 +48,9 @@ putTerminal'' mc tm mcf = ps0PushPS (PutTerminal tm)
btid = fromJust (_plMID btpl)
mcid = fromJust (_plMID mcpl)
mcKillLinked :: Machine -> World -> World
mcKillLinked mc = mcKillTerm mc
mcKillTerm :: Machine -> World -> World
mcKillTerm mc w = fromMaybe w $ do
tmid <- _mcTermMID mc
+3 -2
View File
@@ -57,9 +57,9 @@ sensorCommand :: TerminalCommand
sensorCommand = TerminalCommand
{ _tcString = "SENSOR"
, _tcAlias = ["SEN"]
, _tcHelp = "ACCESS THE CONNECTED SENSOR."
, _tcHelp = "ACCESS INFORMATION CONCERNING THE CONNECTED SENSOR."
, _tcArgumentType = Just "A SENSOR PARAMETER"
, _tcArguments = \_ _ -> ["BOOL","VALUE"]
, _tcArguments = \_ _ -> ["REQUIREMENT","DISTANCE","CURRENTSTATUS","PASTSTATUS"]
, _tcEffect = effectArgMessage sensf
}
effectArgMessage :: (String -> Terminal -> World -> Maybe [String])
@@ -71,6 +71,7 @@ effectArgMessage f args tm w = maybe (Left "") Right $ do
sensf :: String -> Terminal -> World -> Maybe [String]
sensf arg tm w = case arg of
-- "REQUIREMENT","DISTANCE","CURRENTSTATUS","PASTSTATUS"]
"BOOL" -> Just [show $ w ^? machines . ix (_tmMachineID tm) . mcSensor . sensToggle]
_ -> Nothing