Пример #1
0
 @Override
 public void onUpdate() {
   for (Unit unit : units) {
     if (unit.isEnabled()) {
       unit.onUpdate();
     }
   }
 }
Пример #2
0
  @Override
  public int createSlots(int id) {
    for (Unit unit : units) {
      id = unit.createSlots(id);
    }

    return id;
  }
Пример #3
0
 @Override
 public void onClick(GuiBase gui, int mX, int mY, int button) {
   for (Unit unit : units) {
     if (unit.isEnabled()) {
       unit.onClick(gui, mX, mY);
     }
   }
 }
Пример #4
0
  @Override
  public void draw(GuiBase gui, int mX, int mY) {
    gui.prepare();
    gui.drawRect(
        BAR_HORIZONTAL_X,
        BAR_HORIZONTAL_Y,
        0,
        TEXTURE_SHEET_SIZE - BAR_THICKNESS,
        BAR_WIDTH,
        BAR_THICKNESS);
    gui.drawRect(
        BAR_VERTICAL_X,
        BAR_VERTICAL_Y,
        TEXTURE_SHEET_SIZE - BAR_THICKNESS,
        0,
        BAR_THICKNESS,
        BAR_HEIGHT);

    for (Unit unit : units) {
      if (unit.isEnabled()) {
        unit.draw(gui, mX, mY);
      }
    }
  }