Package cnam.nsy208.sudoku.bluetooth

Examples of cnam.nsy208.sudoku.bluetooth.BtClient


     */
    public void setGridFromServer(String pseudo) {
        setSudokuViewIsReady(false);
        setTextSudokuView("", "Inscription en cours");
        _grid.setGrid(81);
        _client = new SudokuClient(this, pseudo);

    }
View Full Code Here


     * Génére une grille et démarre le serveur Sudoku
     * @param diff : Difficulté de la grille
     */
    public void sendGrid(int diff) {
        _grid.setGrid(diff);
        _serv = new SudokuServer(this, _grid.getGrid());
    }
View Full Code Here

        _number = 0 ;
        _score = 100 ;
        _isInitServ = false;
        _endlog = false ;
        _gridcharServ = grid ;
        _checkTimeOut = new CheckTimeOut(this);
       
        start();
    }
View Full Code Here

     */
    public Sudoku() {
        super();
        _display = Display.getDisplay(this);

        _rank = new Ranking();
        _grid = new SudokuGrid();
        _grid.setGrid(81);
        _timerTop = null;

        _clientServerMode = TYPE_CLIENT;
View Full Code Here

     * Enregistre le score du joueur dans un fichier
     */
    public void saveArcadeScore() {
        int score = ((int) this.getEndArcadeTime() - (int) this.getStartAcardeTime())/ 1000;
        _persist = new SudokuPersist(_diff);
        _rank = new Ranking();
        if (_persist.find()!=null)
            _rank = _persist.find();
        this.setRank(_rank);
        this.addPlayer(_rank.getNbPlayer() + 1, _logView.getField().getString(), score);
        _persist.update(_rank);
View Full Code Here

   * Permet de récupérer un objet via son ID
   * @return
   */
  public Ranking find() {
        byte data[] = null;
        Ranking rank = null;
        try {
            _recordId = -1;

            // Find the first available record
            RecordEnumeration re = _rs.enumerateRecords(null, null, false);
            while (re.hasNextElement()) {
                _recordId = re.nextRecordId();
            }

            // If a record was found then load it
            if (_recordId != -1) {
                data = _rs.getRecord(_recordId);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

        // if there is data then restore the deck information
        if (data != null) {
            try {
                rank = new Ranking();
                rank.setBytes(data);
            } catch (Exception e) {
                System.out.println(e);
            }
        }

View Full Code Here

    public Sudoku() {
        super();
        _display = Display.getDisplay(this);

        _rank = new Ranking();
        _grid = new SudokuGrid();
        _grid.setGrid(81);
        _timerTop = null;

        _clientServerMode = TYPE_CLIENT;
        _typeGameMode = MODE_SOLO;
View Full Code Here

            _uuidSet[0] = uid ;
           
            LocalDevice localDevice = LocalDevice.getLocalDevice();
            _discoveryAgent = localDevice.getDiscoveryAgent();
            _discoveryAgent.startInquiry(DiscoveryAgent.GIAC, this);
            _timer = new TimerClient(Sudoku.TIMEOUT_GAME_SEC);
            _active = 1;
         } catch (Exception e) {
            System.out.println(e);
        }
    }
View Full Code Here

    /**
     * Démarrage du timer de top départ
     */
    public void sendStartTop() {
        _timerTop = new TimerStartTop( _serv, LOGIN_TIME_SEC ) ;
        _timerTop.start();
    }
View Full Code Here

    /**
     * Enregistre le score du joueur dans un fichier
     */
    public void saveArcadeScore() {
        int score = ((int) this.getEndArcadeTime() - (int) this.getStartAcardeTime())/ 1000;
        _persist = new SudokuPersist(_diff);
        _rank = new Ranking();
        if (_persist.find()!=null)
            _rank = _persist.find();
        this.setRank(_rank);
        this.addPlayer(_rank.getNbPlayer() + 1, _logView.getField().getString(), score);
View Full Code Here

TOP

Related Classes of cnam.nsy208.sudoku.bluetooth.BtClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.