Work on orienting positions for attachment items
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
module Dodge.Item.Grammar (
|
||||
invLDT,
|
||||
invTrees',
|
||||
invTrees,
|
||||
invIndentIM,
|
||||
invAdj,
|
||||
@@ -168,3 +169,12 @@ invTrees = IM.unions . map (ldtToIM getindex . fmap (^. _1)) . map (bimap _iatTy
|
||||
getindex i =
|
||||
fromMaybe (error "in invTrees try to get non-inventory item tree") $
|
||||
i ^? itLocation . ilInvID
|
||||
|
||||
-- returns an intmap with trees for all root items
|
||||
invTrees' :: IM.IntMap Item -> IM.IntMap (LabelDoubleTree ItemLink Item)
|
||||
invTrees' = IM.unions . map (ldtToIM getindex . fmap (^. _1)) . map (bimap id (\(x, y, _) -> (x, y))) . invLDT
|
||||
where
|
||||
getindex :: Item -> Int
|
||||
getindex i =
|
||||
fromMaybe (error "in invTrees try to get non-inventory item tree") $
|
||||
i ^? itLocation . ilInvID
|
||||
|
||||
Reference in New Issue
Block a user