2005-02-05 12:14:56 +01:00
|
|
|
/*****************************************************************************
|
|
|
|
* Copyright (C) 1999-2005 Eliot
|
|
|
|
* Authors: Antoine Fraboulet <antoine.fraboulet@free.fr>
|
|
|
|
* Olivier Teuliere <ipkiss@via.ecp.fr>
|
|
|
|
*
|
2005-02-24 09:06:24 +01:00
|
|
|
* $Id: training.h,v 1.4 2005/02/24 08:06:25 ipkiss Exp $
|
2005-02-05 12:14:56 +01:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _TRAINING_H_
|
|
|
|
#define _TRAINING_H_
|
|
|
|
|
|
|
|
#include "game.h"
|
2005-02-17 21:01:59 +01:00
|
|
|
#include "results.h"
|
2005-02-05 12:14:56 +01:00
|
|
|
|
|
|
|
using std::string;
|
|
|
|
|
|
|
|
|
|
|
|
class Training: public Game
|
|
|
|
{
|
2005-02-24 09:06:24 +01:00
|
|
|
friend class GameFactory;
|
2005-02-05 12:14:56 +01:00
|
|
|
public:
|
|
|
|
virtual GameMode getMode() const { return kTRAINING; }
|
2005-02-09 23:33:56 +01:00
|
|
|
virtual string getModeAsString() const { return "Training"; }
|
2005-02-05 12:14:56 +01:00
|
|
|
|
|
|
|
/*************************
|
|
|
|
* Game handling
|
|
|
|
*************************/
|
|
|
|
virtual int start();
|
|
|
|
virtual int setRackRandom(int, bool, set_rack_mode);
|
|
|
|
virtual int play(const string &iCoord, const string &iWord);
|
|
|
|
virtual int endTurn();
|
2005-02-17 21:01:59 +01:00
|
|
|
void search();
|
2005-02-05 12:14:56 +01:00
|
|
|
int playResult(int);
|
|
|
|
int setRackManual(bool iCheck, const string &iLetters);
|
|
|
|
|
2005-02-17 21:01:59 +01:00
|
|
|
/*************************
|
|
|
|
* Functions to access the current search results
|
|
|
|
* The int parameter should be 0 <= int < getNResults
|
|
|
|
*************************/
|
|
|
|
int getNResults() const;
|
|
|
|
string getSearchedWord(int) const;
|
|
|
|
string getSearchedCoords(int) const;
|
|
|
|
int getSearchedPoints(int) const;
|
|
|
|
int getSearchedBonus (int) const;
|
|
|
|
|
|
|
|
/*************************
|
|
|
|
* testplay will place a temporary word on the board for
|
|
|
|
* preview purpose
|
|
|
|
* return value is
|
|
|
|
* 0 : ok
|
|
|
|
* 2 : not enough played rounds for the request
|
|
|
|
*************************/
|
|
|
|
int testPlay(int);
|
|
|
|
int removeTestPlay();
|
|
|
|
|
|
|
|
private:
|
2005-02-24 09:06:24 +01:00
|
|
|
// Private constructor and destructor to force using the GameFactory class
|
|
|
|
Training(const Dictionary &iDic);
|
|
|
|
virtual ~Training();
|
|
|
|
|
2005-02-17 21:01:59 +01:00
|
|
|
// Search results, with all the possible rounds
|
|
|
|
Results m_results;
|
2005-02-05 12:14:56 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* _TRAINING_H_ */
|