コード例 #1
0
ファイル: AnimBuilder.java プロジェクト: pavkata/tripleplay
  protected static Animation.Value onScaleY(final Layer layer) {
    Asserts.checkNotNull(layer);
    return new Animation.Value() {
      public float initial() {
        return layer.scaleY();
      }

      public void set(float value) {
        layer.setScaleY(value);
      }
    };
  }
コード例 #2
0
ファイル: AnimBuilder.java プロジェクト: pavkata/tripleplay
  /** Starts a tween on the supplied layer's transparency. */
  public Animation.One tweenAlpha(final Layer layer) {
    Asserts.checkNotNull(layer);
    return tween(
        new Animation.Value() {
          public float initial() {
            return layer.alpha();
          }

          public void set(float value) {
            layer.setAlpha(value);
          }
        });
  }
コード例 #3
0
ファイル: AnimBuilder.java プロジェクト: pavkata/tripleplay
  /**
   * Tweens the volume of the supplied sound. Useful for fade-ins and fade-outs. Note, this does not
   * play or stop the sound, those must be enacted separately.
   */
  public Animation.One tweenVolume(final Sound sound) {
    Asserts.checkNotNull(sound);
    return tween(
        new Animation.Value() {
          public float initial() {
            return sound.volume();
          }

          public void set(float value) {
            sound.setVolume(value);
          }
        });
  }
コード例 #4
0
ファイル: Logic.java プロジェクト: threerings/atlantis
  /**
   * Notes the specified piecement placement, assigns it a claim group and propagates its claim
   * information to connected tiles. The tile placement associated with this piecen must have
   * already been added via {@link #addPlacement}.
   */
  public void addPiecen(Piecen piecen) {
    _piecens.put(piecen.loc, piecen);

    // make sure a play exists at the appropriate location
    Placement play =
        Asserts.checkNotNull(
            _plays.get(piecen.loc), "Piecen played at location where no tile exists? %s", piecen);

    List<TileFeature> flist = Lists.newArrayList();
    enumerateGroup(play, play.getFeature(piecen.featureIdx), flist);
    int claimGroup = ++_claimGroupCounter;
    for (TileFeature feat : flist) {
      // one of these calls will result in this piecen's claim group being mapped
      getClaim(feat.play).setClaimGroup(feat.feature, claimGroup);
    }
  }
コード例 #5
0
ファイル: Sprite.java プロジェクト: rfabbri/pet
 /** Set the current sprite via the sprite's id. */
 public void setSprite(String id) {
   setSprite(Asserts.checkNotNull(spriteIdMap.get(id), "Invalid sprite id"));
 }