Пример #1
0
 @Override
 public void poll() {
   for (GroundItem groundItem : ctx.groundItems.select().select(priceFilter).within(20)) {
     if (groundItem.valid()) {
       final int price = GeItem.price(groundItem.id());
       priceMap.put(groundItem.id(), price);
     }
   }
   Condition.sleep(600);
 }
Пример #2
0
 @Override
 public void repaint(Graphics graphics) {
   if (show) {
     final FontMetrics fm = graphics.getFontMetrics();
     graphics.setFont(calibri);
     for (GroundItem groundItem : ctx.groundItems.select().select(displayFilter)) {
       graphics.setColor(Color.BLACK);
       final Point center = groundItem.centerPoint();
       final String displayString =
           groundItem.name()
               + " x"
               + groundItem.stackSize()
               + " - $"
               + format.format((priceMap.get(groundItem.id()) * groundItem.stackSize()));
       final int width = fm.stringWidth(displayString);
       final int height = fm.getHeight();
       graphics.fillRoundRect(
           center.x - (width / 2), center.y + (height / 2), width + 4, height + 5, 10, 10);
       graphics.setColor(Color.WHITE);
       graphics.drawString(
           displayString, center.x - (width / 2) + 2, center.y + (height / 2) + height);
     }
   }
 }
Пример #3
0
 @Override
 public boolean accept(GroundItem groundItem) {
   return priceMap.containsKey(groundItem.id()) && groundItem.inViewport();
 }
Пример #4
0
 @Override
 public boolean accept(GroundItem groundItem) {
   return !priceMap.containsKey(groundItem.id());
 }