Android Open Source - androidtbsgame Cell






From Project

Back to project page androidtbsgame.

License

The source code is released under:

MIT License

If you think the Android project androidtbsgame listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package de.mmssb.androidtbsgame.andengine.entities.board;
//  w  w w.j a v  a2  s . c  o  m
/**
 * Cell Shape - Is going to be extended soon
 * 
 * @author Manu
 * 
 */
public class Cell {
  public enum CellType {
    PLAIN, FOREST, MOUNTAIN, RIVER
  }

  private CellType cellType;

  /**
   * Creates an instance of {@link Cell}
   * 
   * @param cellType
   *            the cell's type
   */
  public Cell(CellType cellType) {
    this.cellType = cellType;
  }

  /**
   * @return the value, which is subtracted from the amount of steps a unit
   *         can do that turn when entering this cell
   */
  public int getMovementSubtractionValue() {
    switch (cellType) {
    case PLAIN:
      return 1;
    case FOREST:
      return 2;
    case MOUNTAIN:
      return 3;
    case RIVER:
      return 1;
    default:
      return -1;
    }
  }

  public CellType getCellType() {
    return cellType;
  }

  public void setCellType(CellType cellType) {
    this.cellType = cellType;
  }
}




Java Source Code List

de.mmssb.androidtbsgame.andengine.BoardMap.java
de.mmssb.androidtbsgame.andengine.GameControl.java
de.mmssb.androidtbsgame.andengine.MainActivity.java
de.mmssb.androidtbsgame.andengine.Model.java
de.mmssb.androidtbsgame.andengine.entities.board.Board.java
de.mmssb.androidtbsgame.andengine.entities.board.Cell.java
de.mmssb.androidtbsgame.andengine.entities.board.Mark.java
de.mmssb.androidtbsgame.andengine.hud.ImageButtonSprite.java
de.mmssb.androidtbsgame.andengine.hud.ModelHUD.java
de.mmssb.androidtbsgame.andengine.managers.CellControl.java
de.mmssb.androidtbsgame.andengine.managers.Manager.java
de.mmssb.androidtbsgame.andengine.managers.ResourceManager.java
de.mmssb.androidtbsgame.andengine.managers.SceneManager.java
de.mmssb.androidtbsgame.andengine.managers.SharedPreferencesManager.java
de.mmssb.androidtbsgame.andengine.scenes.GameScene.java
de.mmssb.androidtbsgame.andengine.scenes.ModelScene.java
de.mmssb.androidtbsgame.andengine.units.AnimationProperties.java