Fix more item bugs

This commit is contained in:
2025-08-24 23:50:16 +01:00
parent c2daa86463
commit d776c91cfd
9 changed files with 113 additions and 99 deletions
+4 -2
View File
@@ -1,6 +1,7 @@
{-# OPTIONS_GHC -Wno-unused-imports #-}
module Dodge.TestString where
import Data.List ((\\))
import ShortShow
import Geometry
import qualified SDL
@@ -30,13 +31,14 @@ import NewInt
import Data.Foldable
testStringInit :: Universe -> [String]
testStringInit u = map f (IM.elems $ u ^. uvWorld . cWorld . lWorld . items)
testStringInit u = map f (IM.toList $ u ^. uvWorld . cWorld . lWorld . items)
<> ["---"]
<> map show (IM.toList . fold $ u ^? uvWorld . cWorld . lWorld . creatures . ix 0 . crInv)
<> ["---"]
<> map show (IM.keys $ u ^. uvWorld . cWorld . lWorld . floorItems)
where
f itm = show (itm ^. itID . unNInt) <> ":"<> show (itm ^. itLocation)
f (i,itm) = show i <> ":" <> show (itm ^. itID . unNInt) <> ":"<> shortShow (itm ^. itLocation)
-- map shortShow (u ^.. uvWorld . cWorld . lWorld . debris . each . to g)
-- where
-- g db = (pz,z,norm v)