Skip to content

v2.0.0

Latest
Compare
Choose a tag to compare
@markozajc markozajc released this 14 Apr 16:19

The game loop has been completely revised to suit the updated Akinator API, and to better fit an OOP model - questions are no longer answered through the Akiwrapper object, but instead use Question#answer(Answer). Guess has been changed similarly. Additionally, we can no longer request guesses from the API, instead they are returned whenever Akinator is confident enough. Query, a common parent of Question and Guess has been created to fit this model, and user code is meant to switch logic based on its type.

Please consult the example code or the README to find out how the new API is used.

Breaking changes

  • Akiwrapper#suggestGuess(), #getGuesses(), and #getGuessesAboveProbability() have been removed as the API no longer lets us list guesses on demand.
  • Akiwrapper#answer(Answer) has been moved to Question#answer(Answer).
  • Akiwrapper#undoAnswer() has been moved to Question#undoAnswer().
  • Akiwrapper#confirmGuess(Guess) has been moved to Guess#confirm().
  • Akiwrapper#rejectLastGuess() has been moved to Guess#reject().
  • Akiwrapper#getStep() has been moved to Query#getStep().
  • Akiwrapper#getServer() has been removed.
  • Akiwrapper#getQuestion has been renamed to Akiwrapper#getCurrentResponse().
  • GuessType has been renamed to Theme to more accurately reflect its purpose.
  • Language and Theme (previously GuessType) enums have been moved to Akiwrapper.
  • Theme.MOVIE_TV_SHOW and Theme.PLACE have been removed removed as no language seems to support them.
  • Server has been removed. We now interact with <language>.akinator.com directly, so server URLs are no longer known or needed.
  • ServerNotFoundException has been renamed to LanguageThemeCombinationException
  • Status has been converted to an enum and moved to the .utils.route package, Status.Level and Status.Reason enums have been removed. Akinator no longer provides a status reason in the "completion" key, so only the level is know.
  • Guess#isExplicit() has been removed. Akinator no longer provides the "corrupt" key, and its purpose was speculation on my part to begin with.
  • Guess#getProbability() has been removed, as it is no longer known.
  • Guess#getGain() has been removed as it is no longer known.
  • Identifiable has been removed, and its functionality moved to Guess. We can no longer reliably tell a Question's ID, so it only makes sense for Guess to have it.
  • The deprecated AkiwrapperBuilder#DEFAULT_LOCALICATION has been removed.

Deprecations

  • Question#getQuestion() has been deprecated and renamed to Question#getText().
  • Akiwrapper#isExhausted() has been deprecated.
  • AkinatorException#getDebugInformation() has been deprecated and will always return an empty string.

Additions

  • Query, a common parent of Question and Guess, has been added.
  • Guess#getPseudonym() has been added.

Other changes

  • Guess#getDescription() is now @Nonnull (was previously @Nullable).