Package ch.fusun.baron.unit.ui

Source Code of ch.fusun.baron.unit.ui.UnitTileChild

package ch.fusun.baron.unit.ui;

import ch.fusun.baron.map.ui.gef.editpart.TileChild;
import ch.fusun.baron.swt.isometry.components.Sprite;
import ch.fusun.baron.unit.Unit;

/**
* The unit tile child
*/
public class UnitTileChild implements TileChild<Unit> {

  private static final String ICONS_UNIT_MASK = "icons/unit_mask.png"; //$NON-NLS-1$
  private static final String ICON1_UNIT = "icons/unit.png"; //$NON-NLS-1$
  private final Unit unit;

  /**
   * @param unit
   *            the unit
   */
  public UnitTileChild(Unit unit) {
    this.unit = unit;
  }

  @Override
  public Unit getModel() {
    return unit;
  }

  @Override
  public Sprite getSprite() {
    return new Sprite(Activator.getImage(ICON1_UNIT),
        Activator.getImage(ICONS_UNIT_MASK), 30);
  }
}
TOP

Related Classes of ch.fusun.baron.unit.ui.UnitTileChild

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.