Fix combination bug with small inventories
This commit is contained in:
@@ -48,12 +48,10 @@ lookupItemsUsingTrie ((mods,ct,i,n):xs) t = do
|
||||
let is = replicate n' (mods,i)
|
||||
concatMap (map (first (is ++)) . lookupItemsUsingTrie xs) $ maybeToList (_trieChildren t M.!? (n',ct))
|
||||
|
||||
invertListInvMult :: IM.IntMap Item
|
||||
-> [[(M.Map ModuleSlot ItemModule,CombineType,Int,Int)]]
|
||||
invertListInvMult :: IM.IntMap Item -> [[(M.Map ModuleSlot ItemModule,CombineType,Int,Int)]]
|
||||
invertListInvMult = powlistUpToN 4 . invertListInv
|
||||
|
||||
invertListInv :: IM.IntMap Item
|
||||
-> [(M.Map ModuleSlot ItemModule,CombineType,Int,Int)]
|
||||
invertListInv :: IM.IntMap Item -> [(M.Map ModuleSlot ItemModule,CombineType,Int,Int)]
|
||||
invertListInv = IM.foldrWithKey
|
||||
(\k it -> ((_itModules it,_itType it, k, itStackAmount it) :) )
|
||||
[]
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
module Dodge.Initialisation where
|
||||
import Dodge.Default.World
|
||||
--import Dodge.Combine
|
||||
--import Dodge.Base.You
|
||||
--import Dodge.Base
|
||||
--import Dodge.Save
|
||||
import Dodge.Data
|
||||
@@ -39,4 +41,5 @@ initialWorld = defaultWorld
|
||||
}
|
||||
|
||||
testStringInit :: World -> [String]
|
||||
testStringInit w = [show $ length $ _magnets w]
|
||||
--testStringInit = map (concatMap $ \(_,ct,_,_) -> show ct) . invertListInvMult . yourInv
|
||||
testStringInit = const []
|
||||
|
||||
Reference in New Issue
Block a user