/**
  * Sets the animation.
  *
  * @param animation The animation to set
  */
 public void setAnimation(Animation animation) {
   if (animation != null) {
     assert animation.isCreated();
   }
   this.animation = animation;
   rewind();
 }
 /**
  * Sets the sprite's appearance.
  *
  * @param appearance
  */
 public void setAppearance(Appearance appearance) {
   if (appearance == null) {
     image = null;
     setAnimation(null);
     rewind();
   } else {
     appearance.toSprite(this);
   }
 }