Package com.drakulo.games.ais.core.delayed

Examples of com.drakulo.games.ais.core.delayed.ColonyAction


      if (data.getSpecialActions() != null) {
        // There id some special action to show
        int col = 0;
        int row = 0;
        for (String name : data.getSpecialActions()) {
          final ColonyAction sa = SpecialActionManager.get(
              GameData.getSelectedColony(), name);
          ImageButton btn = this.buildingButtons[col][row];
          btn.setImageRef(sa.getGfxKey());
          btn.setActionHandler(new ActionHandler() {

            @Override
            public void run() {
              if (ResourceHelper.enoughResourcesFor(sa
                  .getCostMap())) {
                sa.setLinkedBuilding(SectorState.this.selectedBuilding);
                final Colony cc = GameData.getSelectedColony();
                for (Resource r : Resource.values()) {
                  BigDecimal d = sa.getCostMap().get(r);
                  if (d == null) {
                    continue;
                  }
                  cc.updateResource(r, d.negate());
                }
                GameData.getSelectedColony().addSpecialAction(
                    sa);
              } else {
                // TODO Play error sound
              }
            }
          });
          btn.show();
          if (getSelectedBuildingAction() == null) {
            btn.enable();
          } else {
            btn.disable();
          }
          if (btn.isHovered()) {
            showUpgradeCost(sa.getCostMap(), g, btn);
          }
          col++;
          if (col == 3) {
            col = 0;
            row++;
View Full Code Here


            + "...";
      }
      maxValue = BigDecimal.valueOf(ba.getDuration());
      value = BigDecimal.valueOf(ba.getCurrentValue());
    } else if (a instanceof ColonyAction) {
      ColonyAction sa = (ColonyAction) a;
      title = FontHelper.firstToUpper(I18n.get(sa.getI18nKey())) + "...";
      this.selectedBuildingPB.setFilledColor(Color.red);
      maxValue = BigDecimal.valueOf(sa.getDuration());
      value = BigDecimal.valueOf(sa.getCurrentValue());
    }

    if (a != null) {
      fontNormal.drawString(x, y += 35, title);
View Full Code Here

TOP

Related Classes of com.drakulo.games.ais.core.delayed.ColonyAction

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.