eliot-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Eliot-dev] Changes to eliot/game/training.h [antoine-1]


From: eliot-dev
Subject: [Eliot-dev] Changes to eliot/game/training.h [antoine-1]
Date: Sun, 23 Oct 2005 13:16:40 -0400

Index: eliot/game/training.h
diff -u /dev/null eliot/game/training.h:1.10.2.1
--- /dev/null   Sun Oct 23 17:16:40 2005
+++ eliot/game/training.h       Sun Oct 23 17:16:24 2005
@@ -0,0 +1,93 @@
+/*****************************************************************************
+ * Copyright (C) 1999-2005 Eliot
+ * Authors: Antoine Fraboulet <address@hidden>
+ *          Olivier Teuliere  <address@hidden>
+ *
+<<<<<<< training.h
+=======
+ * $Id: training.h,v 1.10.2.1 2005/10/23 17:16:24 afrab Exp $
+ *
+>>>>>>> 1.10
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *****************************************************************************/
+
+/* $Id: training.h,v 1.10.2.1 2005/10/23 17:16:24 afrab Exp $ */
+
+#ifndef _TRAINING_H_
+#define _TRAINING_H_
+
+#include <string>
+
+#include "game.h"
+#include "results.h"
+
+
+/**
+ * This class handles the logic specific to a training game.
+ * As its name indicates, it is not a game in the literal meaning of the word,
+ * in particular because the rack can be set at will.
+ * Note: No player should be added to this game, a human player is added
+ * automatically (in the start() method)
+ */
+class Training: public Game
+{
+    friend class GameFactory;
+public:
+    virtual GameMode getMode() const { return kTRAINING; }
+    virtual std::string getModeAsString() const { return "Training"; }
+
+    /*************************
+     * Game handling
+     *************************/
+    
+    /// play a round on the board
+    virtual int play(int player, Round& round);
+    virtual int back();
+
+    /// search for the best possibilities
+    void search();
+    const Results& getResults() const { return m_results; }
+
+    /// play result 'n'
+    int  playResult(int);
+
+    /// Place a temporary word on the board for preview purpose
+    void testPlay(int);
+
+    /// Remove the temporary word(s)
+    void removeTestPlay();
+
+    /// Get the temporary word
+    std::string getTestPlayWord();
+    
+    int setRack(PlayedRack::set_rack_mode mode, bool check, std::string rack);
+
+private:
+    // Private constructor and destructor to force using the GameFactory class
+    Training(const Dictionary iDic);
+    virtual ~Training();
+
+    // Search results, with all the possible rounds
+    Round   testRound;
+    Results m_results;
+};
+
+#endif /* _TRAINING_H_ */
+
+
+/// Local Variables:
+/// mode: hs-minor
+/// c-basic-offset: 4
+/// End:




reply via email to

[Prev in Thread] Current Thread [Next in Thread]