Cleanup
This commit is contained in:
@@ -39,6 +39,10 @@ itemCombinations = map (first toMultiset) $
|
||||
, p [RIFLE,SPRING,CAN] assaultRifle
|
||||
|
||||
, p [PIPE,PIPE,PIPE,HARDWARE] bangRod
|
||||
, p [BANGROD,PLANK,HARDWARE] elephantGun
|
||||
, p [ELEPHANTGUN,HARDWARE,TIN] amr
|
||||
, p [ELEPHANTGUN,HARDWARE,CAN] sniperRifle
|
||||
, p [BANGROD,PLATE,DRUM,MOTOR] machineGun
|
||||
|
||||
, p [TUBE,TUBE,TUBE,HARDWARE] launcher
|
||||
]
|
||||
@@ -49,7 +53,7 @@ itemCombinations = map (first toMultiset) $
|
||||
p = (,)
|
||||
|
||||
combinations :: [(M.Map CombineType Int, CombineType)]
|
||||
combinations = map (second _itCombineType) itemCombinations
|
||||
combinations = map (second _itType) itemCombinations
|
||||
|
||||
combineToItem :: M.Map CombineType Int -> Maybe Item
|
||||
combineToItem m = lookup m itemCombinations
|
||||
@@ -82,7 +86,7 @@ itemMultisets (i,it) = case it ^? itConsumption . itAmount' of
|
||||
Nothing -> [ ([i], M.singleton thetype 1 ) ]
|
||||
Just n -> map (\k -> (replicate k i, M.singleton thetype k)) [1..n]
|
||||
where
|
||||
thetype = _itCombineType it
|
||||
thetype = _itType it
|
||||
|
||||
|
||||
itemTypeAmounts :: Item -> [[CombineType]]
|
||||
@@ -90,13 +94,13 @@ itemTypeAmounts it = case it ^? itConsumption . itAmount' of
|
||||
Nothing -> [[thetype]]
|
||||
Just i -> map (`replicate` thetype) [1 .. i]
|
||||
where
|
||||
thetype = _itCombineType it
|
||||
thetype = _itType it
|
||||
|
||||
combineItemListYou :: World -> [([Int],Item)]
|
||||
combineItemListYou = combineItemList . yourInv
|
||||
|
||||
combineListYou :: World -> [([Int],CombineType)]
|
||||
combineListYou = fmap (second _itCombineType) . combineItemListYou
|
||||
combineListYou = fmap (second _itType) . combineItemListYou
|
||||
|
||||
toggleCombineInv :: World -> World
|
||||
toggleCombineInv w = case _inventoryMode w of
|
||||
|
||||
Reference in New Issue
Block a user