示例#1
0
  @Override
  protected void drawOnContainer(Graphics g) {
    // draw target arrows immediately above stack for active item only
    if (activeItem != null) {
      Vector2 arrowOrigin =
          new Vector2(
              activeItem.getLeft()
                  + VStack.CARD_WIDTH * FCardPanel.TARGET_ORIGIN_FACTOR_X
                  + VStack.PADDING
                  + VStack.BORDER_THICKNESS,
              activeItem.getTop()
                  + VStack.CARD_HEIGHT * FCardPanel.TARGET_ORIGIN_FACTOR_Y
                  + VStack.PADDING
                  + VStack.BORDER_THICKNESS);

      PlayerView activator = activeStackInstance.getActivatingPlayer();
      arrowOrigin = arrowOrigin.add(screenPos.x, screenPos.y);

      StackItemView instance = activeStackInstance;
      while (instance != null) {
        for (CardView c : instance.getTargetCards()) {
          TargetingOverlay.drawArrow(g, arrowOrigin, c, activator.isOpponentOf(c.getController()));
        }
        for (PlayerView p : instance.getTargetPlayers()) {
          TargetingOverlay.drawArrow(g, arrowOrigin, p, activator.isOpponentOf(p));
        }
        instance = instance.getSubInstance();
      }
    }
  }
示例#2
0
  // temporarily reveal zones targeted by active stack instance
  private void revealTargetZones() {
    if (activeStackInstance == null) {
      return;
    }

    final Set<ZoneType> zones = new HashSet<ZoneType>();
    playersWithValidTargets = new HashMap<PlayerView, Object>();
    for (final CardView c : activeStackInstance.getTargetCards()) {
      if (c.getZone() != null) {
        zones.add(c.getZone());
        playersWithValidTargets.put(c.getController(), c);
      }
    }
    if (zones.isEmpty() || playersWithValidTargets.isEmpty()) {
      return;
    }
    MatchController.instance.openZones(zones, playersWithValidTargets);
  }