Cleanup, remove records, stop unecessary Aeson compile

This commit is contained in:
2025-06-06 20:43:49 +01:00
parent d3de40d432
commit d2d4642380
22 changed files with 311 additions and 340 deletions
+6 -5
View File
@@ -6,13 +6,14 @@ module Dodge.Combine.Combinations
, bulletWeapons
) where
import Dodge.Data.CombAmount
import Dodge.Data.Magnet
import Dodge.Item.Ammo
import Dodge.Data.Item
import Dodge.Item
import LensHelp
watchCombinations :: [([(ItAmount, ItemType)], Item)]
watchCombinations :: [([(CombAmount, ItemType)], Item)]
watchCombinations =
[]
-- [ po [HELD TIMESTOPPER, HELD REWINDER] timeScroller
@@ -23,7 +24,7 @@ watchCombinations =
-- po xs it = (map o xs, it)
-- o = (1,)
backpackCombinations :: [([(ItAmount,ItemType)],Item)]
backpackCombinations :: [([(CombAmount,ItemType)],Item)]
backpackCombinations =
[ po [CRAFT HOSE, CRAFT STEELDRUM] fuelPack
]
@@ -39,7 +40,7 @@ backpackCombinations =
-- po xs it = (map o xs, it)
-- o = (1,)
magazineCombinations :: [([(ItAmount,ItemType)],Item)]
magazineCombinations :: [([(CombAmount,ItemType)],Item)]
magazineCombinations =
[ po [CRAFT TIN, CRAFT SPRING] tinMag
]
@@ -50,9 +51,9 @@ magazineCombinations =
flatItemCombinations :: [([ItemType], Item)]
flatItemCombinations = map (over _1 (concatMap f)) itemCombinations
where
f (x,it) = replicate (_getItAmount x) it
f (x,it) = replicate (_getCombAmount x) it
itemCombinations :: [([(ItAmount, ItemType)], Item)]
itemCombinations :: [([(CombAmount, ItemType)], Item)]
itemCombinations =
watchCombinations ++
backpackCombinations ++
+3 -2
View File
@@ -4,6 +4,7 @@ module Dodge.Combine.Graph
( combinationsDotGraph
) where
import Dodge.Data.CombAmount
import Data.Bifunctor
import qualified Data.Graph.Inductive as FGL
import Data.GraphViz.Attributes.Complete
@@ -21,7 +22,7 @@ data CombClust
| JoinClust
deriving (Eq, Ord, Show, Enum, Bounded)
newtype CombNode = CombNode {_unCombNode :: Either ItemType [(ItAmount, ItemType)]}
newtype CombNode = CombNode {_unCombNode :: Either ItemType [(CombAmount, ItemType)]}
deriving (Eq, Ord, Show)
instance Labellable CombNode where
@@ -68,7 +69,7 @@ itemCombinationsEdges = concatMap (f . over _2 _itType) itemCombinations
| otherwise = (CombNode $ Right abts, CombNode $ Left bt, 0) : map g abts
where
bts = map snd abts
g (am, bt') = (CombNode $ Left bt', CombNode $ Right abts, _getItAmount am)
g (am, bt') = (CombNode $ Left bt', CombNode $ Right abts, _getCombAmount am)
combinationsGraph :: FGL.Gr CombNode CombEdge
combinationsGraph =