Cleanup
This commit is contained in:
@@ -118,8 +118,7 @@ itemToFunction itm = case itm ^. itType of
|
||||
HELD{} -> case itUseCondition itm of
|
||||
UseableWhenAimed -> HeldPlatformSF
|
||||
_ -> GadgetPlatformSF
|
||||
_
|
||||
| Just amtype <- magAmmoType itm-- ^? itConsumables . magType
|
||||
_ | Just amtype <- magAmmoType itm-- ^? itConsumables . magType
|
||||
, Just _ <- itm ^? itLocation . ilEquipSite . _Just ->
|
||||
AmmoMagSF 0 amtype
|
||||
AMMOMAG{} -> maybe NoSF (AmmoMagSF 0) $ magAmmoType itm -- ^? itConsumables . magType
|
||||
@@ -161,16 +160,12 @@ type DTComb a = DTree a -> DTree a -> Maybe (DTree a)
|
||||
|
||||
leftIsParentCombine :: DTComb CItem
|
||||
leftIsParentCombine ltree rtree = do
|
||||
let l = rightChildList ltree
|
||||
xs = dropWhile (\s -> not $ S.member s (treeToPotentialFunction rtree)) l
|
||||
sf <- safeHead xs
|
||||
sf <- find (`S.member` treeToPotentialFunction rtree) (rightChildList ltree)
|
||||
return $ ltree & dtRight .:~ ( rtree & dtValue . _2 .~ sf)
|
||||
|
||||
rightIsParentCombine :: DTComb CItem
|
||||
rightIsParentCombine ltree rtree = do
|
||||
let l = leftChildList rtree
|
||||
xs = dropWhile (\s -> not $ S.member s (treeToPotentialFunction ltree)) l
|
||||
sf <- safeHead xs
|
||||
sf <- find (`S.member` treeToPotentialFunction ltree) (leftChildList rtree)
|
||||
return $ rtree & dtLeft .:~ ( ltree & dtValue . _2 .~ sf)
|
||||
|
||||
leftChildList :: DTree CItem -> [ItemSF]
|
||||
|
||||
Reference in New Issue
Block a user