Package net.hearthstats.game

Examples of net.hearthstats.game.Screen


        throw new IllegalStateException("Unable to identify screen because previous screen "
            + previousScreen + " has no nextScreens parameter");
      }
    }

    Screen match = null;

    // Try to perform and exact match on the screen we were last on -- it's the
    // most likely one to match, of course!
    if (previousScreen != null) {
      if (checkForExactMatch(image, previousScreen)) {
        // This screen matches
        log.trace("Exact match on previous screen {}", previousScreen);
        match = previousScreen;
      }
    }

    // Try to find an exact match for the screens, based on the primary pixels
    // only
    if (match == null) {
      for (Screen screen : possibleScreens) {
        if (checkForExactMatch(image, screen)) {
          // This screen matches
          if (log.isDebugEnabled()) {
            if (match == null) {
              log.trace("Exact match on new screen {}", screen);
            } else {
              log.warn(
                  "More that one screen matched! Matched screen {}, but have already matched {}",
                  screen, match);
            }
          }

          match = screen;

          // If not running in debug mode, we can skip the rest of the loop for
          // efficiency
          if (!log.isDebugEnabled())
            break;
        }
      }
    }

    if (match == null) {
      // A check of the primary pixels did not find an exact match, so try for a
      // partial match
      log.debug("Did not find exact screen match, attempting partial match");

      Map<Screen, PartialResult> screenMatchesMap = new HashMap<>();
      int maxMatchedCount = 0;
      int maxUnmatchedCount = 0;
      Screen bestMatch = null;

      EnumSet<Screen> possibleScreensIncludingPrevious = EnumSet.copyOf(possibleScreens);
      if (previousScreen != null) {
        possibleScreensIncludingPrevious.add(previousScreen);
      }
View Full Code Here


        for (File image : imageArray) {
            if (image.getName().endsWith(".png")) {
                // Determine if this is a match end image
                BufferedImage bufferedImage = ImageIO.read(image);

                Screen screen = analyser.identifyScreen(bufferedImage, null);

                if (screen == Screen.MATCH_NAXXRAMAS_END || screen == Screen.MATCH_ORGRIMMAR_END || screen == Screen.MATCH_PANDARIA_END
                        || screen == Screen.MATCH_STORMWIND_END || screen == Screen.MATCH_STRANGLETHORN_END) {
                    // This is a match end screen, so it is suitable for testing with the RelativePixelAnalyser
                    images.add(image);
View Full Code Here

TOP

Related Classes of net.hearthstats.game.Screen

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.