Work on connecting pathfinding grid
This commit is contained in:
@@ -63,7 +63,7 @@ applyTerminalCommandArguments :: String -> [String] -> Universe -> Universe
|
||||
applyTerminalCommandArguments command args u = case command of
|
||||
"ITEM" -> fromMaybe u $ do
|
||||
(ibt,n) <- parseItem args
|
||||
return $ u & uvWorld %~ (flip (foldr ($)) $ replicate n (snd . createPutItem (itemFromBase ibt)))
|
||||
return $ u & uvWorld %~ flip (foldr ($)) (replicate n (snd . createPutItem (itemFromBase ibt)))
|
||||
_ -> u
|
||||
|
||||
parseItem :: [String] -> Maybe (ItemBaseType,Int)
|
||||
@@ -77,10 +77,6 @@ parseItem [] = Nothing
|
||||
parseNum :: [String] -> Int
|
||||
parseNum xs = fromMaybe 1 $ xs ^? ix 0 >>= readMaybe
|
||||
|
||||
safeTake2 :: [a] -> Maybe [a]
|
||||
safeTake2 (x:y:_) = Just (x:y:[])
|
||||
safeTake2 _ = Nothing
|
||||
|
||||
showTerminalError :: String -> String -> Universe -> Universe
|
||||
showTerminalError cmd s = menuLayers .:~ InputScreen (T.pack cmd) s
|
||||
|
||||
|
||||
Reference in New Issue
Block a user