93 lines
3.5 KiB
Haskell
93 lines
3.5 KiB
Haskell
{-# OPTIONS_GHC -Wno-unused-imports #-}
|
|
module Dodge.TestString where
|
|
|
|
import Dodge.WallCreatureCollisions
|
|
import Data.List ((\\))
|
|
import ShortShow
|
|
import Geometry
|
|
import qualified SDL
|
|
import Linear
|
|
import Dodge.ListDisplayParams
|
|
import Dodge.SelectionSections
|
|
import qualified Control.Foldl as L
|
|
import Dodge.DoubleTree
|
|
import Dodge.Data.DoubleTree
|
|
import Dodge.Item.Grammar
|
|
import Dodge.Item.Display
|
|
import AesonHelp
|
|
import Dodge.SmoothScroll
|
|
import HelpNum
|
|
import Dodge.Base.Coordinate
|
|
import Geometry.Vector
|
|
import Data.Maybe
|
|
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 qualified IntMapHelp as IM
|
|
import qualified Data.Map.Strict as M
|
|
import NewInt
|
|
import Data.Foldable
|
|
import Data.Monoid
|
|
import RandomHelp
|
|
|
|
testStringInit :: Universe -> [String]
|
|
testStringInit u = fmap show $ u ^.. uvWorld . cWorld . lWorld . creatures . ix 0 . crWallTouch . each
|
|
-- (fmap show $ u ^.. uvWorld . cWorld . lWorld . creatures . each . crStance . carriage . strideAmount)
|
|
-- a <> fromMaybe [] (do
|
|
-- a w1 <- u ^? uvWorld . cWorld . lWorld . walls . ix 18
|
|
-- a w2 <- u ^? uvWorld . cWorld . lWorld . walls . ix 61
|
|
-- a let
|
|
-- a f = uncurry (-) . (^. wlLine)
|
|
-- a g = argV . f
|
|
-- a h = normalizeV . uncurry (-) . (^. wlLine)
|
|
-- a a = angleVV (f w1) (f w2)
|
|
-- a return [show $ wlWlCrush w1 w2, show a , show (f w1), show (f w2)
|
|
-- a , show $ g w1
|
|
-- a , show $ g w2
|
|
-- a , show $ h w1
|
|
-- a , show $ h w2
|
|
-- a , show (norm (h w1 + h w2))
|
|
-- a ]
|
|
-- a )
|
|
-- <> (fmap show $ u ^.. uvWorld . cWorld . lWorld . machines . each . mcMaterial)
|
|
--testStringInit u = map show (u ^.. uvWorld . cWorld . lWorld . machines . traverse . mcDir)
|
|
--testStringInit u = map show
|
|
-- (u ^.. uvWorld . cWorld . lWorld . machines . traverse .mcType . _McDistributer)
|
|
-- <>
|
|
-- map f (u ^.. uvWorld . cWorld . lWorld . machines . traverse)
|
|
-- where
|
|
-- f mc = show (mc ^. mcID) <> shortShow (mc ^. mcType)
|
|
-- [show $ foldMap (foldMap (Sum . length . (^. seObstacles)))
|
|
-- $ u ^. uvWorld . cWorld . incGraph]
|
|
-- foldMap prettyShort $ u ^? uvWorld . cWorld . lWorld . machines . ix 0 . mcType . _McProxSensor
|
|
--testStringInit u = foldMap prettyShort $ u ^.. uvWorld . cWorld . lWorld . machines
|
|
|
|
-- showh _ = ""
|
|
-- shortShow
|
|
|
|
topTestPart :: Universe -> [String]
|
|
topTestPart u = [maybe "" showManObj $ u ^? uvWorld . cWorld . lWorld . creatures . ix 0 . crManipulation . manObject
|
|
]
|
|
|
|
showManObj :: ManipulatedObject -> String
|
|
showManObj SortInventory = "SortInventory"
|
|
showManObj (SelectedItem x y z) = "SelItem: "++ show x++ " Root: "++show y++" Attached: "++show z
|
|
showManObj SelNothing = "SelNothing"
|
|
showManObj SortCloseItem = "SortCloseItem"
|
|
showManObj (SelCloseItem x) = "CloseItem " ++ show x
|
|
showManObj SortCloseButton = "SortCloseButton"
|
|
showManObj (SelCloseButton x) = "CloseButton " ++ show x
|
|
|
|
showTimeFlow :: TimeFlowStatus -> String
|
|
showTimeFlow tfs = case tfs of
|
|
RespawnDelay i -> "Respawndelay"++show i
|
|
NormalTimeFlow -> "NormalTimeFlow"
|
|
ItemScrollTimeFlow {_reverseAmount = ra } -> "ItemScrollTimeFlow" ++ show ra
|
|
CameraScrollTimeFlow {_reverseAmount = ra } -> "CameraScrollTimeFlow" ++ show ra
|
|
RewindLeftClick {_reverseAmount = ra } -> "RewindLeftClick" ++ show ra
|
|
PausedTimeFlow {_timeFlowCharge = ra } -> "PausedTimeFlow" ++ show ra
|
|
PauseTimeMessage {} -> "PausedTimeMessage"
|