Android Open Source - abalone-android Move Type






From Project

Back to project page abalone-android.

License

The source code is released under:

GNU General Public License

If you think the Android project abalone-android 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

/**
* Copyright (c) 2010-2011 Yaroslav Geryatovich, Alexander Yakushev
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*///from  ww w  .j av  a  2 s . c  o  m
package com.bytopia.abalone.mechanics;

/**
 * Service class that represents a type of move made on the specific board.
 * 
 * @author Bytopia
 */
public class MoveType {

  /**
   * Represents a move that cannot be made.
   */
  public static final int NOMOVE = 0;

  /**
   * Represents a leaping move.
   */
  public static final int LEAP = 1;

  /**
   * Represents a pushing move without interacting with enemy marbles.
   */
  public static final int SILENTPUSH = 2;

  /**
   * Represents a enemy pushing move.
   */
  public static final int ENEMYPUSH = 3;

  /**
   * Result type of the move.
   */
  private int result;

  /**
   * All cells that are moved with this move.
   */
  private Group cells;

  /**
   * Cells that are to be highlighted if this move is about to be performed.
   */
  private Group highlightedCells;

  /**
   * Constructs a new move type with result type only.
   * 
   * @param result
   *            result type of the move
   */
  public MoveType(int result) {
    this(result, null, null);
  }

  /**
   * Constructs a new move type with all given parameters.
   * 
   * @param result
   *            result type of the move
   * @param group
   *            group of all cells that are moved
   * @param highGroup
   *            group of cells that should be highlighted by Watcher if this
   *            move is about to be performed.
   */
  public MoveType(int result, Group group, Group highGroup) {
    this.result = result;
    cells = group;
    highlightedCells = highGroup;
  }

  /**
   * Returns the result type of the move
   * 
   * @return result type
   */
  public int getResult() {
    return result;
  }

  /**
   * Returns the group of cells that are moved with this move.
   * 
   * @return group of cells that are to be moved
   */
  public Group getMovedCells() {
    return cells;
  }

  /**
   * Returns the group of cells that are to be highlighted during this move.
   * Used by Watcher implementations.
   * 
   * @return group of cells that are to be highlighted
   */
  public Group getHighlightedCells() {
    return highlightedCells;
  }

}




Java Source Code List

com.bytopia.abalone.BoardRenderer.java
com.bytopia.abalone.BoardView.java
com.bytopia.abalone.GameActivity.java
com.bytopia.abalone.GameOptionsActivity.java
com.bytopia.abalone.LoseBallsView.java
com.bytopia.abalone.MainMenuActivity.java
com.bytopia.abalone.Options.java
com.bytopia.abalone.Scenario.java
com.bytopia.abalone.SelectLayoutActivity.java
com.bytopia.abalone.SplashAcitvity.java
com.bytopia.abalone.TutorialActivity.java
com.bytopia.abalone.TutorialBoardView.java
com.bytopia.abalone.mechanics.AiAnn.java
com.bytopia.abalone.mechanics.AiBeatrice.java
com.bytopia.abalone.mechanics.AiCharlotte.java
com.bytopia.abalone.mechanics.AiDeborah.java
com.bytopia.abalone.mechanics.ArtificialIntilligence.java
com.bytopia.abalone.mechanics.BelgianLayout.java
com.bytopia.abalone.mechanics.Board.java
com.bytopia.abalone.mechanics.Cell.java
com.bytopia.abalone.mechanics.ClassicLayout.java
com.bytopia.abalone.mechanics.ConsoleWatcher.java
com.bytopia.abalone.mechanics.Debug.java
com.bytopia.abalone.mechanics.Direction.java
com.bytopia.abalone.mechanics.EmptyLayout.java
com.bytopia.abalone.mechanics.Game.java
com.bytopia.abalone.mechanics.GermanLayout.java
com.bytopia.abalone.mechanics.Group.java
com.bytopia.abalone.mechanics.Layout.java
com.bytopia.abalone.mechanics.MoveType.java
com.bytopia.abalone.mechanics.Move.java
com.bytopia.abalone.mechanics.Player.java
com.bytopia.abalone.mechanics.Side.java
com.bytopia.abalone.mechanics.TestLayout.java
com.bytopia.abalone.mechanics.Watcher.java