[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Eliot-dev] Changes to eliot/game/freegame.h [antoine-1]
From: |
eliot-dev |
Subject: |
[Eliot-dev] Changes to eliot/game/freegame.h [antoine-1] |
Date: |
Sun, 23 Oct 2005 13:16:31 -0400 |
Index: eliot/game/freegame.h
diff -u /dev/null eliot/game/freegame.h:1.8.2.1
--- /dev/null Sun Oct 23 17:16:31 2005
+++ eliot/game/freegame.h Sun Oct 23 17:16:24 2005
@@ -0,0 +1,58 @@
+/*****************************************************************************
+ * Copyright (C) 2005 Eliot
+ * Authors: Olivier Teuliere <address@hidden>
+ *
+ * $Id: freegame.h,v 1.8.2.1 2005/10/23 17:16:24 afrab Exp $
+ *
+ * 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
+ *****************************************************************************/
+
+#ifndef _FREEGAME_H_
+#define _FREEGAME_H_
+
+#include "game.h"
+#include "tile.h"
+
+
+/**
+ * This class handles the logic specific to a "free" game.
+ *
+ * The algorithm is simple: players play at their turn, and they can either
+ * play a word or change letters (changing letters implies passing its turn).
+ *
+ * When a player has no more letters (end of the game), the points of the
+ * letters left in the racks of his opponents are added to his score, and
+ * removed from the score of the latters.
+ */
+class FreeGame: public Game
+{
+ friend class GameFactory;
+public:
+ virtual GameMode getMode() const { return kFREEGAME; }
+ virtual std::string getModeAsString() const { return "Free game"; }
+
+ /*************************
+ * Game handling
+ *************************/
+ virtual int play(int player, Round& round);
+ virtual int back();
+
+private:
+ // Private constructor and destructor to force using the GameFactory class
+ FreeGame(const Dictionary iDic);
+ virtual ~FreeGame();
+};
+
+#endif /* _FREEGAME_H_ */
- [Eliot-dev] Changes to eliot/game/freegame.h [antoine-1],
eliot-dev <=