Remove (by commenting out) module item-type system

This commit is contained in:
2024-09-30 11:42:10 +01:00
parent 4545caa7e6
commit 0701c4043e
37 changed files with 877 additions and 696 deletions
+11 -4
View File
@@ -1,4 +1,5 @@
module Dodge.Item.Grammar (
invLDT,
invTrees,
invIndentIM,
invAdj,
@@ -38,12 +39,14 @@ basePartiallyComposedItem itm = case itm ^. itType . iyBase of
[(WeaponTargetingSF,WeaponTargetingLink), (WeaponScopeSF,WeaponScopeLink)]
)
AMMOMAG _ -> ammoComposedItem itm
TARGETING {} -> (itm,WeaponTargetingSF, LinkTest (const Nothing) (const Nothing))
TARGETING {} -> (itm,WeaponTargetingSF, useBreakListsLinkTest [(AugmentedHUDSF,AugmentedHUDLink)] [])
ATTACH ZOOMSCOPE -> (itm,WeaponScopeSF, LinkTest (const Nothing) (const Nothing))
ATTACH HOMINGMODULE -> (itm,AmmoTargetingSF ProjectileAmmo, LinkTest (const Nothing) (const Nothing))
HOMING {}
-> (itm,AmmoTargetingSF BulletAmmo, LinkTest (const Nothing) (const Nothing))
ATTACH REMOTESCREEN -> (itm,RemoteScreenSF, LinkTest (const Nothing) (const Nothing))
ATTACH AUGMENTEDHUD -> nolinks AugmentedHUDSF
BULLETMOD BulletModTrajectory {} -> nolinks $ AmmoTargetingSF BulletAmmo
BULLETMOD BulletModPayload {} -> nolinks $ AmmoPayloadSF BulletAmmo
BULLETMOD BulletModEffect {} -> nolinks $ AmmoEffectSF BulletAmmo
ATTACH REMOTESCREEN -> nolinks RemoteScreenSF
ATTACH BULLETSYNTHESIZER -> (itm,AmmoModifierSF BulletAmmo, LinkTest (const Nothing) (const Nothing))
LEFT {} -> isolate
EQUIP {} -> isolate
@@ -51,6 +54,7 @@ basePartiallyComposedItem itm = case itm ^. itType . iyBase of
CRAFT {} -> isolate
-- _ ->
where
nolinks x = (itm,x, LinkTest (const Nothing) (const Nothing))
isolate = (itm,UncomposableIsolateSF, LinkTest (const Nothing) (const Nothing))
ammoComposedItem :: Item -> PartiallyComposedItem
@@ -61,6 +65,8 @@ ammoComposedItem itm = fromMaybe (error "in ammoComposedItem, wrong item") $ do
, useBreakListsLinkTest
[(AmmoModifierSF atype, AmmoModLink)
,(AmmoTargetingSF atype, AmmoTargetingLink)
,(AmmoPayloadSF atype, AmmoPayloadLink)
,(AmmoEffectSF atype, AmmoEffectLink)
,(RemoteScreenSF, RemoteScreenLink)
]
[]
@@ -150,6 +156,7 @@ invIndentIM :: IM.IntMap Item -> IM.IntMap (Item, Int, LabelDoubleTreeNodeType C
invIndentIM = IM.fromAscList . zip [0 ..] . reverse . map (over _1 (^. _1))
. concatMap ldtToIndentList . invLDT
-- returns an intmap with trees for all items, including non-roots
invTrees :: IM.IntMap Item -> IM.IntMap (LabelDoubleTree ComposeLinkType Item)
invTrees = IM.unions . map (ldtToIM getindex . fmap (^. _1)) . invLDT
where