reformat console output for a more compact layout

This commit is contained in:
Jesse D. McDonald 2014-09-01 18:09:20 -05:00
parent 748fe76f4a
commit 6b9df9680c
1 changed files with 12 additions and 14 deletions

View File

@ -54,13 +54,10 @@ printWaterdeep :: WaterdeepState -> IO ()
printWaterdeep w = do printWaterdeep w = do
let playerStates = map snd $ IM.toAscList $ w ^. gamePlayerStates let playerStates = map snd $ IM.toAscList $ w ^. gamePlayerStates
clearScreen clearScreen
putStrLn ("Players: " ++ intercalate ", " (map (^. playerName) playerStates)) printf "Round %d; First Player: %s; Current Player: %s\n"
putStrLn ("First Player: " ++ (w ^. gameCurrentRound)
(w ^. gamePlayerState (w ^. gameFirstPlayer) . playerName)) (w ^. gamePlayerState (w ^. gameFirstPlayer) . playerName)
putStrLn ("Current Round: " ++ show (w ^. gameCurrentRound)) (w ^. gamePlayerState (w ^. gameCurrentPlayer) . playerName)
let p = w ^. gameCurrentPlayer
when (p /= noPlayerID) $
putStrLn ("Current Player: " ++ (w ^. gamePlayerState p . playerName))
putStrLn "" putStrLn ""
putStrLn "Cliffwatch Inn:" putStrLn "Cliffwatch Inn:"
forM_ (w ^. gameCliffwatchInn) $ \q -> do forM_ (w ^. gameCliffwatchInn) $ \q -> do
@ -74,14 +71,15 @@ printWaterdeep w = do
(b ^. buildingAccumulation) (b ^. buildingAccumulation)
putStrLn "" putStrLn ""
forM_ playerStates $ \p -> do forM_ playerStates $ \p -> do
printf "%s's State (%s):\n" (p ^. playerName) printf "%s's State (%s; %d points; %d agents):\n" (p ^. playerName)
(show (p ^. playerFaction . factionColor)) (show (p ^. playerFaction . factionColor))
putStrLn (" Score: " ++ show (p ^. playerScore)) (p ^. playerScore)
putStrLn (" Tavern: " ++ (p ^. playerTavern . to showTavern)) (p ^. playerAgentsInPool)
putStrLn (" Incomplete: " ++ showItems (p ^.. playerIncompleteQuests . traverse . questTitle)) putStrLn (" Tavern: " ++ (p ^. playerTavern . to showTavern))
putStrLn (" Complete: " ++ showItems (p ^.. playerCompletedQuests . traverse . questTitle)) putStrLn (" Incomplete: " ++ showItems (p ^.. playerIncompleteQuests . traverse . questTitle))
putStrLn (" Intrigues: " ++ showItems (p ^.. playerIntrigueCards . traverse . intrigueTitle)) putStrLn (" Complete: " ++ showItems (p ^.. playerCompletedQuests . traverse . questTitle))
putStrLn (" Agent Pool: " ++ show (p ^. playerAgentsInPool)) putStrLn (" Plot Quests: " ++ showItems (p ^.. playerPlotQuests . traverse . questTitle))
putStrLn (" Intrigues: " ++ showItems (p ^.. playerIntrigueCards . traverse . intrigueTitle))
putStrLn "" putStrLn ""
showItems :: [String] -> String showItems :: [String] -> String