Package moe.maika.ygofm.gamedata
Class SeedSearch.Builder
java.lang.Object
moe.maika.ygofm.gamedata.SeedSearch.Builder
- Enclosing class:
- SeedSearch
A builder for
SeedSearch
instances. Use a new builder for each search.
The builder is not thread-safe and should not be reused after building an instance.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the seed search.withCallbackAfterEachHit
(Consumer<RNG> callback) Sets a callback to be run after each successfully found seed.withCallbackAfterEachIteration
(Runnable callback) Sets a callback to be run after each iteration of the search.withInitialSeed
(RNG initialSeed) Sets the initial seed to use for the search.withSort
(Comparator<? super Card> sorter) Sets the sort order for the deck.withSpace
(int end) Sets the range of seeds to explore.withSpace
(int start, int end) Sets the range of seeds to explore.
-
Constructor Details
-
Builder
Creates a new builder for a seed search.- Parameters:
deck
- the deckdrawnCards
- the cards drawn from the deck in the order they were drawn
-
-
Method Details
-
withSort
Sets the sort order for the deck. The default is to sort by card ID.- Parameters:
sorter
- the sort performed on the Build Deck screen before the duel- Returns:
- this builder
-
withSpace
Sets the range of seeds to explore. The default is 0 to 5,000,000.- Parameters:
end
- the end of the seed space to explore- Returns:
- this builder
-
withSpace
Sets the range of seeds to explore. The default is 0 to 5,000,000.- Parameters:
start
- the start of the seed space to exploreend
- the end of the seed space to explore- Returns:
- this builder
-
withCallbackAfterEachIteration
Sets a callback to be run after each iteration of the search. This can be used to provide feedback to the user or to cancel the search.- Parameters:
callback
- the callback to run after each iteration of the search- Returns:
- this builder
-
withCallbackAfterEachHit
Sets a callback to be run after each successfully found seed. This can be used to provide feedback to the user or to cancel the search.- Parameters:
callback
- the callback to run after each hit in the search- Returns:
- this builder
-
withInitialSeed
Sets the initial seed to use for the search. The default is 0x55555555 (the value initialized after boot on the Konami screen).- Parameters:
initialSeed
- the initial seed to use for the search- Returns:
- this builder
-
build
Builds the seed search.- Returns:
- the seed search
-