WellSource2DView.java :  » Game » Arianne-RPG-0.83 » games » stendhal » client » gui » j2d » entity » Java Open Source

Java Open Source » Game » Arianne RPG 0.83 
Arianne RPG 0.83 » games » stendhal » client » gui » j2d » entity » WellSource2DView.java
/*
 * @(#) games/stendhal/client/gui/j2d/entity/GoldSource2DView.java
 *
 * $Id: WellSource2DView.java,v 1.11 2009/03/17 15:45:37 astridemma Exp $
 */

package games.stendhal.client.gui.j2d.entity;

//
//

import games.stendhal.client.entity.ActionType;

import java.util.List;

/**
 * The 2D view of a gold source.
 */
class WellSource2DView extends AnimatedLoopEntity2DView {

  //
  // Entity2DView
  //

  /**
   * Build a list of entity specific actions. <strong>NOTE: The first entry
   * should be the default.</strong>
   * 
   * @param list
   *            The list to populate.
   */
  @Override
  protected void buildActions(final List<String> list) {
    list.add(ActionType.WISH.getRepresentation());

    super.buildActions(list);
  }

  //
  // EntityView
  //

  /**
   * Perform the default action.
   */
  @Override
  public void onAction() {
    onAction(ActionType.WISH);
  }

  /**
   * Perform an action.
   * 
   * @param at
   *            The action.
   */
  @Override
  public void onAction(final ActionType at) {
    switch (at) {
    case WISH:
      at.send(at.fillTargetInfo(entity.getRPObject()));
      break;

    default:
      super.onAction(at);
      break;
    }

  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.