MoveBase.java :  » Game » chessit » com » m2m » chess » Android Open Source

Android Open Source » Game » chessit 
chessit » com » m2m » chess » MoveBase.java
package com.m2m.chess;

public class MoveBase {
  protected final int from;
  protected final int to;

  public MoveBase(int from, int to) {
    this.from = from;
    this.to = to;
  }

  public final int getFrom() {
    return from;
  }

  public final int getTo() {
    return to;
  }

  public final int getFromRow() {
    return from >> 3;
  }

  public final int getFromCol() {
    return from % 8;
  }

  public final int getToRow() {
    return to >> 3;
  }

  public final int getToCol() {
    return to % 8;
  }
}
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.