Files
loop/src/Dodge/TestString.hs
T

39 lines
1.7 KiB
Haskell

module Dodge.TestString where
import Dodge.Render.ShapePicture
import Dodge.Render.Lights
import Data.Aeson (ToJSON)
import Data.ByteString.Lazy.Char8 (unpack)
import qualified Data.Aeson.Encode.Pretty as AEP
import Control.Lens
import Dodge.Data.Universe
--import Data.Maybe
--import ShortShow
--import qualified Data.Map.Strict as M
--import qualified IntMapHelp as IM
testStringInit :: Universe -> [String]
testStringInit u = [show $ length $ lightsToRender (u ^. uvConfig) (u ^. uvWorld . cWorld . camPos)
(u ^. uvWorld . cWorld . lWorld)
, show $ length $ fst $ worldSPic (u ^. uvConfig) (u ^. uvWorld)
, show $ length $ snd $ worldSPic (u ^. uvConfig) (u ^. uvWorld)
, show $ u ^. uvWorld . input . scrollTestInt
]
--[show $ u ^? uvWorld . hud . hudElement . diSections . sssExtra . sssSelPos . _Just]
-- [show $ fmap IM.keys $ u ^? uvWorld . hud . hudElement . subInventory . ciSections . sssSections]
getPretty :: ToJSON a => a -> [String]
getPretty = lines . unpack . AEP.encodePretty' (AEP.Config (AEP.Spaces 2) compare AEP.Generic False)
showTimeFlow :: TimeFlowStatus -> String
showTimeFlow tfs = case tfs of
DeathTime i -> "DeathTime"++show i
NormalTimeFlow -> "NormalTimeFlow"
ScrollTimeFlow {_reverseAmount = ra } -> "ScrollTimeFlow" ++ show ra
RewindLeftClick {_reverseAmount = ra } -> "RewindLeftClick" ++ show ra
PausedTimeFlow {_timeFlowCharge = ra } -> "PausedTimeFlow" ++ show ra
-- [ show $ u ^? uvScreenLayers . _head . scOffset
-- ]
-- ++ [ shortShow $ u ^?! uvWorld . cWorld . lWorld . creatures . ix 0 . crPos
-- ]
-- ++ map show (M.toList (u ^. uvWorld . input . pressedKeys))