コード例 #1
0
  protected List<SButton> getAllOrderButtons(List<? extends Humanoid> selectedHumanoids) {
    Game kc = Rpg.getGame();

    allOrderButtons.clear();
    orders.clear();
    orderTypes.clear();

    if (selectedHumanoids == null) return allOrderButtons;

    for (LivingThing lt : selectedHumanoids)
      if (lt.getPossibleOrders() != null) orders.addAll(lt.getPossibleOrders());

    List<? extends Humanoid> unitsOrdering = selectedHumanoids;

    OrderButton abButton;

    for (Order o : orders) {
      if (orderTypes.contains(o.getOrderType())) continue;

      abButton =
          OrderButton.getInstance(kc.getActivity(), o, null, unitsOrdering, ui.getSoldierOrders());

      allOrderButtons.add(abButton);

      orderTypes.add(o.getOrderType());
    }

    return allOrderButtons;
  }
コード例 #2
0
  protected List<SButton> getAllOrderButtons(Humanoid selectedHumanoid) {
    Game kc = Rpg.getGame();

    allOrderButtons.clear();
    orders.clear();
    orderTypes.clear();

    if (selectedHumanoid != null)
      if (selectedHumanoid.getPossibleOrders() != null)
        orders.addAll(selectedHumanoid.getPossibleOrders());

    ArrayList<Humanoid> unitsOrdering = null;

    for (Order o : orders) {
      if (orderTypes.contains(o.getOrderType())) continue;

      OrderButton abButton =
          OrderButton.getInstance(
              kc.getActivity(), o, selectedHumanoid, unitsOrdering, ui.getSoldierOrders());

      allOrderButtons.add(abButton);

      orderTypes.add(o.getOrderType());
    }

    return allOrderButtons;
  }
コード例 #3
0
  protected List<SButton> determineIfAndWhatToDisplay(List<? extends Humanoid> lts) {
    Game game = Rpg.getGame();
    Level level = game.getLevel();

    lt = null;
    this.lts = lts;

    if (lts == null || lts.isEmpty()) return null;

    ArrayList<SButton> buttons = new ArrayList<>();

    buttons.addAll(getAllOrderButtons(lts));
    buttons.addAll(getAllAbilityButtons(lts));

    Team team = level.getMM().getTeam(lts.get(0).getTeamName());

    return buttons;
  }
コード例 #4
0
  protected List<SButton> getAllAbilityButtons(Humanoid selectedHumanoid) {
    Game kc = Rpg.getGame();
    allAbilityButtons.clear();

    abilities.clear();
    abilitiesTypes.clear();

    if (selectedHumanoid != null) abilities.addAll(selectedHumanoid.getAbilities());

    for (Ability ab : abilities) {
      if (abilitiesTypes.contains(ab.getAbility())) continue;

      AbilityButton abButton = AbilityButton.getInstance(kc.getActivity(), ab, ac);
      allAbilityButtons.add(abButton);
      abilitiesTypes.add(ab.getAbility());
    }

    return allAbilityButtons;
  }
コード例 #5
0
  protected List<SButton> determineIfAndWhatToDisplay(Humanoid lt) {
    Game game = Rpg.getGame();
    Level level = game.getLevel();

    this.lt = lt;
    lts = null;

    if (lt == null) return null;

    List<SButton> buttons = new ArrayList<>();

    buttons.addAll(getAllOrderButtons(lt));
    buttons.addAll(getAllAbilityButtons(lt));

    // Team team = level.getMM().getTeam( lt.getTeamName() );

    //		if( Settings.yourBaseMode && lt instanceof Humanoid && !(lt instanceof Worker)){
    //
    //			buttons.add( AddToArmyButton.getInstance( game , (Humanoid) lt ,  team.getArmy() ,
    // team.getArmyManager() ));
    //		}

    return buttons;
  }