eliot-dev
[Top][All Lists]
Advanced

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

[Eliot-dev] eliot/game history.h history.cpp


From: eliot-dev
Subject: [Eliot-dev] eliot/game history.h history.cpp
Date: Mon, 26 Dec 2005 19:19:42 +0000

CVSROOT:        /cvsroot/eliot
Module name:    eliot
Branch:         
Changes by:     Antoine Fraboulet <address@hidden>      05/12/26 19:19:42

Modified files:
        game           : history.h history.cpp 

Log message:
        Makefile.am

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/eliot/eliot/game/history.h.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/eliot/eliot/game/history.cpp.diff?tr1=1.4&tr2=1.5&r1=text&r2=text

Patches:
Index: eliot/game/history.cpp
diff -u eliot/game/history.cpp:1.4 eliot/game/history.cpp:1.5
--- eliot/game/history.cpp:1.4  Mon Dec 26 15:33:15 2005
+++ eliot/game/history.cpp      Mon Dec 26 19:19:42 2005
@@ -26,9 +26,11 @@
 
 #include <string>
 #include "rack.h"
-#include "history.h"
+#include "pldrack.h"
+#include "round.h"
 #include "turn.h"
 #include "debug.h"
+#include "history.h"
 
 /* ******************************************************** */
 /* ******************************************************** */
@@ -38,6 +40,7 @@
 History::History()
 {
     Turn* t = new Turn ();
+    m_history.clear();
     m_history.push_back(t);
 }
 
Index: eliot/game/history.h
diff -u eliot/game/history.h:1.4 eliot/game/history.h:1.5
--- eliot/game/history.h:1.4    Mon Dec 26 15:33:15 2005
+++ eliot/game/history.h        Mon Dec 26 19:19:42 2005
@@ -33,6 +33,23 @@
 class PlayedRack;
 class Round;
 
+/**
+ * History stores all the turns that have been played
+ * This class is used many times in the game
+ *  - one for the complete game
+ *  - one for each of the players
+ *
+ * A History is never empty (getSize() can be used as the is the current turn
+ * number for the complete game history). The top of the history is an empty
+ * Turn until it has been filled and game is up to a new round.
+ * 
+ * getCurrentRack() can/should be used to store the current played rack. 
+ * setCurrentRack must be called whenever the current played rack is
+ * modified.
+ * 
+ * History owns the turns that it stores. Do not delete a turn referenced by 
History
+ */
+
 class History
 {
  public:
@@ -72,6 +89,7 @@
 
 
 /// Local Variables:
+/// mode: c++
 /// mode: hs-minor
 /// c-basic-offset: 4
 /// End:




reply via email to

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