Remove shrink gun
This commit is contained in:
@@ -202,12 +202,16 @@ invTrees' = IM.unions . map (ldtToIM getindex . fmap (^. _1)) . map (fmap (\(x,
|
||||
-- returns an intmap with trees for all items
|
||||
--invTrees'' :: IM.IntMap Item -> [LocationLDT ItemLink ComposedItem]
|
||||
invTrees'' :: IM.IntMap Item -> IM.IntMap (Int,LocationLDT ItemLink ComposedItem)
|
||||
invTrees'' = IM.unions . map (f . LocLDT TopLDT) . IM.elems . invRootTrees
|
||||
--invTrees'' = map (LocLDT TopLDT) . IM.elems . invRootTrees
|
||||
invTrees'' inv = foldMap (f . LocLDT TopLDT) (IM.elems (invRootTrees inv)) mempty
|
||||
where
|
||||
f t = cldtPropagateFold h h g 0 t mempty
|
||||
f t = cldtPropagateFold h h g 0 t id
|
||||
h x _ _ _ = x + 1
|
||||
g x ldt = IM.insert (ldt ^?! locLDT . ldtValue . cItem . itLocation . ilInvID) (x,ldt)
|
||||
g x ldt = (.) (IM.insert (ldt ^?! locLDT . ldtValue . cItem . itLocation . ilInvID) (x,ldt))
|
||||
--invTrees'' = IM.unions . map (f . LocLDT TopLDT) . IM.elems . invRootTrees
|
||||
-- where
|
||||
-- f t = cldtPropagateFold h h g 0 t mempty
|
||||
-- h x _ _ _ = x + 1
|
||||
-- g x ldt = IM.insert (ldt ^?! locLDT . ldtValue . cItem . itLocation . ilInvID) (x,ldt)
|
||||
|
||||
-- returns an intmap with trees for root items, indexed by inventory position
|
||||
invRootTrees :: IM.IntMap Item -> IM.IntMap (LabelDoubleTree ItemLink ComposedItem)
|
||||
|
||||
Reference in New Issue
Block a user