Add link types to attachment tree

This commit is contained in:
2024-09-11 11:33:08 +01:00
parent c80217a970
commit 60c399935e
6 changed files with 128 additions and 61 deletions
+6 -1
View File
@@ -1,6 +1,7 @@
{-# OPTIONS_GHC -Wno-unused-imports #-}
module Dodge.TestString where
import Dodge.Data.DoubleTree
import Dodge.Item.Grammar
import Dodge.Item.Display
import AesonHelp
@@ -20,7 +21,11 @@ import Dodge.Data.Universe
--import qualified Data.Map.Strict as M
import qualified IntMapHelp as IM
testStringInit :: Universe -> [String]
testStringInit u = maybe [] invTree (u ^? uvWorld . cWorld . lWorld . creatures . ix 0 . crInv)
testStringInit u = fromMaybe mempty $ do
inv <- fmap invLDT $ u ^? uvWorld . cWorld . lWorld . creatures . ix 0 . crInv
return $ concatMap (prettyLDT (\(x,_,_,_) -> take 5 (show $ x ^. itType . iyBase))) inv
--testStringInit u = maybe [] invTree (u ^? uvWorld . cWorld . lWorld . creatures . ix 0 . crInv)
-- [fromMaybe "" $ do
-- cr <- u ^? uvWorld . cWorld . lWorld . creatures . ix 0
-- i <- cr ^? crManipulation . manObject . inInventory . ispItem