Android Open Source - androidtbsgame Board Map






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;
/*from   ww w. j  ava  2  s .c om*/
import de.mmssb.androidtbsgame.andengine.entities.board.Board;
import de.mmssb.androidtbsgame.andengine.managers.SharedPreferencesManager;

/**
 * Holds Data for all cells, which are shown on a {@link Board}
 * 
 * @author Manu
 * 
 */
public class BoardMap implements Comparable<BoardMap> {
  private int columns;
  private int rows;
  private String boardString;

  /**
   * @param raw
   *            string from {@link SharedPreferencesManager}
   */
  public BoardMap(String raw) {
    this.columns = Integer.valueOf(raw.substring(raw.indexOf('[') + 1,
        raw.indexOf('/')));
    this.rows = Integer.valueOf(raw.substring(raw.indexOf('/') + 1,
        raw.indexOf(']')));
    this.boardString = raw.substring(raw.indexOf(']') + 1);
  }

  public int getColumns() {
    return columns;
  }

  public int getRows() {
    return rows;
  }

  public String getBoardString() {
    return boardString;
  }

  @Override
  public String toString() {
    return "[" + columns + "/" + rows + "]" + boardString;
  }

  @Override
  public int compareTo(BoardMap another) {
    return this.getColumns() * this.getRows() - another.getColumns()
        * another.getRows();
  }
}




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