Package ch.fusun.baron.farm.ui

Source Code of ch.fusun.baron.farm.ui.FarmTileChild

package ch.fusun.baron.farm.ui;

import ch.fusun.baron.farm.Farm;
import ch.fusun.baron.map.ui.gef.editpart.TileChild;
import ch.fusun.baron.swt.isometry.components.Sprite;

/**
* Tile child for farms
*/
public class FarmTileChild implements TileChild<Farm> {

  private static final String ICONS_FARM = "icons/farm.png"; //$NON-NLS-1$
  private static final String ICONS_FARM_MASK = "icons/farm_mask.png"; //$NON-NLS-1$
  private final Farm farm;

  /**
   * @param farm
   *            The farm
   */
  public FarmTileChild(Farm farm) {
    this.farm = farm;
  }

  @Override
  public Farm getModel() {
    return this.farm;
  }

  @Override
  public Sprite getSprite() {
    return new Sprite(Activator.getImage(ICONS_FARM),
        Activator.getImage(ICONS_FARM_MASK), 10);
  }

}
TOP

Related Classes of ch.fusun.baron.farm.ui.FarmTileChild

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.