First implementation of no-item-zone sensor

This commit is contained in:
2025-09-16 22:35:53 +01:00
parent 81d6727d8e
commit 103f1e7e99
3 changed files with 47 additions and 53 deletions
+5 -35
View File
@@ -31,42 +31,12 @@ import NewInt
import Data.Foldable
testStringInit :: Universe -> [String]
testStringInit _ = mempty
-- map f (IM.toList $ u ^. uvWorld . cWorld . lWorld . items)
-- <> ["---"]
-- <> map show (IM.toList . fold $ u ^? uvWorld . cWorld . lWorld . creatures . ix 0 . crInv . unNIntMap)
-- <> ["---"]
-- <> map show (IM.keys $ u ^. uvWorld . cWorld . lWorld . floorItems)
--
-- where
-- 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)
-- where
-- v@(V3 _ _ z) = db ^. dbVel
-- (V3 _ _ pz) = db ^. dbPos
-- --return . foldMap (prettyLDT (show . (^. _1 . itType))) . invLDT $ _crInv cr
-- where
-- idp = invDisplayParams $ u ^. uvWorld
-- cfig = u ^. uvConfig
-- yint = posSelSecYint cfig idp y
-- mpos@(V2 _ y) = u ^. uvWorld . input . mousePos
-- , show . fmap (fmap _siPictures) $ u ^? uvWorld . hud . hudElement . diSections . ix (-1) . ssItems
-- <> [[toEnum (i+j * 32) | i <- [0..31]] | j <- [0..7]]
-- <> map show (IM.elems (L.postscan (L.premap _siHeight L.sum)
-- $ fromMaybe mempty $ u ^? uvWorld . hud . hudElement . diSections . sssSections . ix 0 . ssItems)
-- )
--testStringInit u = [maybe mempty show $ u ^? uvWorld . cWorld . lWorld . projectiles . ix 0 . prjUpdates . ix 3 . pjuControllerID]
--testStringInit u = (topTestPart u
-- <>) $ map showh $
---- (IM.toList . IM.filter (\itloc -> itloc ^? ilCrID == Just 0) $ (u ^. uvWorld . cWorld . lWorld . itemLocations)) <>
-- ( IM.elems $ fmap h (u ^?! uvWorld . cWorld . lWorld . creatures . ix 0 . crInv))
-- where
-- h itm = (_itID itm, _itLocation itm)
-- showh (x,(InInv a b c d e)) = show x ++ "," ++ show a ++ "," ++ show b ++"," ++ show c ++"," ++ show d
-- ++ "," ++ show e
testStringInit _ = []
-- 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