package pdp.scrabble;
import static java.lang.Runtime.getRuntime;
import javax.swing.*;
import java.awt.*;
import pdp.scrabble.game.GameEngine;
import pdp.scrabble.game.GameEnvironment;
import pdp.scrabble.game.impl.GameEnvImpl;
import pdp.scrabble.game.impl.SearchPlacementImpl;
import pdp.scrabble.ihm.ChooseModeDialog;
import pdp.scrabble.ihm.GameGEnvImpl;
import pdp.scrabble.ihm.GraphGameEnv;
import pdp.scrabble.ihm.MainFrame;
import pdp.scrabble.utility.Tool;
@SuppressWarnings("unused")
public class Main {
/**
* @param args
*/
public static final String PROGRAM_NAME = "JScrabble";
public static final String PROGRAM_VERSION = "2.0.0";
public static final String SEPARATOR = java.io.File.separator;
public static final String RESSOURCES_PATH = "ressources" + SEPARATOR;
public static final int CPU_CORES_NUMBER = getRuntime().availableProcessors();
private static String lang = null;
private static MainFrame mf=null;
private static GraphGameEnv gameEnv=null;
public static void main(String[] args) {
//choose your language
Tool.pause(250);
lang = Language.init(null);
while(lang==null); //wait
gameEnv = new GameGEnvImpl(null, 0, lang, null);
//choose your play mode
mf = new MainFrame(lang, gameEnv);
GameEngine eng = ChooseModeDialog.mode(gameEnv, mf);
gameEnv.setEngine(eng);
gameEnv.setMainFrame(mf);
mf.initialize();
SearchPlacementImpl.initAnagrams();
}
}