@Test public void testBKParser() throws IOException { BufferedImage image = ImageIO.read(TestImageParser.class.getResourceAsStream(imageLocation + "troop_1435926297125_colored.png")); int parseBarbKingSlot = ImageParser.parseBarbKingSlot(image); Assert.assertEquals(3, parseBarbKingSlot); BufferedImage image2 = ImageIO.read(TestImageParser.class.getResourceAsStream(imageLocation + "troop_1435841575319_colored.png")); int parseBarbKingSlot2 = ImageParser.parseBarbKingSlot(image2); Assert.assertEquals(3, parseBarbKingSlot2); }
static Integer parseBarbKingSlot(BufferedImage image) { Rectangle rectangle = findArea(image, "/images/bk.png"); if (rectangle == null) { return null; } return rectangle.x / ATTACK_GROUP_UNIT_DIFF; }
ImageParser { static Integer parseBarbKingSlot(BufferedImage image) { Rectangle rectangle = findArea(image, "/images/bk.png"); if (rectangle == null) { return null; } return rectangle.x / ATTACK_GROUP_UNIT_DIFF; } }
ImageParser { static Integer parseBarbKingSlot(BufferedImage image) { Rectangle rectangle = findArea(image, "/images/bk.png"); if (rectangle == null) { return null; } return rectangle.x / ATTACK_GROUP_UNIT_DIFF; }  }
ImageParser { static Integer parseBarbKingSlot(BufferedImage image) { Rectangle rectangle = findArea(image, "/images/bk.png"); if (rectangle == null) { return null; } return rectangle.x / ATTACK_GROUP_UNIT_DIFF; }  static int parseGold(BufferedImage image); static int parseElixir(BufferedImage image); static int parseDarkElixir(BufferedImage image); static int[] parseTroopCount(); static int[] parseLoot(); static boolean isCollectorFullBase(); }
ImageParser { static Integer parseBarbKingSlot(BufferedImage image) { Rectangle rectangle = findArea(image, "/images/bk.png"); if (rectangle == null) { return null; } return rectangle.x / ATTACK_GROUP_UNIT_DIFF; }  static int parseGold(BufferedImage image); static int parseElixir(BufferedImage image); static int parseDarkElixir(BufferedImage image); static int[] parseTroopCount(); static int[] parseLoot(); static boolean isCollectorFullBase();  }