Cleanup
This commit is contained in:
@@ -77,19 +77,19 @@ parseItem [] = Nothing
|
||||
parseNum :: [String] -> Int
|
||||
parseNum xs = fromMaybe 1 $ xs ^? ix 0 >>= readMaybe
|
||||
|
||||
showTerminalError :: String -> String -> Universe -> Universe
|
||||
showTerminalError cmd s = uvScreenLayers .:~ InputScreen cmd s
|
||||
showTerminalError :: String -> Universe -> Universe
|
||||
showTerminalError cmd = uvScreenLayers .:~ InputScreen cmd
|
||||
|
||||
applySetTerminalString :: String -> Universe -> Universe
|
||||
applySetTerminalString [] = id
|
||||
applySetTerminalString var = case key' of
|
||||
"" -> showTerminalError ("set " ++ var) ("Unable to read as argument as float: " ++ val)
|
||||
"" -> showTerminalError ("set " ++ var)
|
||||
"hp" -> uvWorld . cWorld . lWorld . creatures . ix 0 . crHP .~ round (fromJust val')
|
||||
-- "invcap" -> uvWorld . cWorld . lWorld . creatures . ix 0 . crInvCapacity .~ round (fromJust val')
|
||||
-- "mass" -> uvWorld . cWorld . lWorld . creatures . ix 0 . crMass .~ fromJust val'
|
||||
-- "mvspeed" -> uvWorld . cWorld . lWorld . creatures . ix 0 . crMvType . mvSpeed .~ fromJust val'
|
||||
"mvspeed" -> uvWorld . cWorld . lWorld . creatures . ix 0 . crType . avMoveSpeed .~ fromJust val'
|
||||
_ -> showTerminalError ("set " ++ var) ("Invalid set command: " ++ key) -- never reached?
|
||||
_ -> showTerminalError ("set " ++ var)
|
||||
where
|
||||
(key, val) = getSplitString var
|
||||
val' = readMaybe val :: Maybe Float
|
||||
|
||||
Reference in New Issue
Block a user