Android Open Source - android-tic-tac-toe Tic Tac Toe Application






From Project

Back to project page android-tic-tac-toe.

License

The source code is released under:

MIT License

If you think the Android project android-tic-tac-toe 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 org.shaon.android.tictactoe;
//  w w  w.  j  a  v  a2s  .  c  o m
import org.shaon.android.tictactoe.board.Board.GameMode;

import android.app.Application;
import android.content.SharedPreferences;

public class TicTacToeApplication extends Application {

  public static final String PREFERENCE_TIC_TAC_TOE = "PreferencesTicTacToe";
  public static final String PREFERENCE_GAME_MODE = "GameMode";
  
  private GameMode gameMode;
  
  @Override
  public void onCreate() {
    super.onCreate();
    loadGameMode();
  }
  
  public void loadGameMode() {
         SharedPreferences settings = getSharedPreferences(PREFERENCE_TIC_TAC_TOE, 0);
         String gameModeStr = settings.getString(PREFERENCE_GAME_MODE, GameMode.VS_GREEN_ROBOT.toString());
         gameMode = GameMode.valueOf(gameModeStr);
  }

  /**
   * @return the gameMode
   */
  public GameMode getGameMode() {
    return gameMode;
  }
}




Java Source Code List

org.shaon.android.tictactoe.TicTacToeApplication.java
org.shaon.android.tictactoe.activity.SettingsActivity.java
org.shaon.android.tictactoe.activity.TicTacToeActivity.java
org.shaon.android.tictactoe.board.Board.java
org.shaon.android.tictactoe.board.Cell.java
org.shaon.android.tictactoe.exception.InvalidTurn.java
org.shaon.android.tictactoe.model.ActionState.java
org.shaon.android.tictactoe.model.Action.java
org.shaon.android.tictactoe.model.AlphaBetaSearch.java
org.shaon.android.tictactoe.model.MinMax.java
org.shaon.android.tictactoe.model.PlayerConfig.java
org.shaon.android.tictactoe.model.SearchAlgorithm.java
org.shaon.android.tictactoe.model.State.java
org.shaon.android.tictactoe.model.TerminatingCondition.java
org.shaon.android.tictactoe.model.WinningCombination.java