Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 1906)
+++ trunk/MagicSoft/Mars/Changelog	(revision 1907)
@@ -1,3 +1,12 @@
                                                  -*-*- END OF LINE -*-*-
+
+ 2003/04/04: Thomas Bretz
+
+   * mtools/MagicReversi.cc:
+     - added support for Number of Players
+     - added instructions
+     - added support for Esc key
+
+
 
  2003/04/04: Wolfgang Wittek
Index: trunk/MagicSoft/Mars/mbase/MAGIC.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MAGIC.h	(revision 1906)
+++ trunk/MagicSoft/Mars/mbase/MAGIC.h	(revision 1907)
@@ -8,7 +8,10 @@
 //
 ///////////////////////////////////////////////////////////////////////////////
-
 #ifndef ROOT_TROOT
 #include <TROOT.h>
+#endif
+
+#if ROOT_VERSION_CODE < ROOT_VERSION(3,02,00)
+#error Your root version is too old to compile Mars, use root>=3.02
 #endif
 
Index: trunk/MagicSoft/Mars/mtools/MagicDomino.h
===================================================================
--- trunk/MagicSoft/Mars/mtools/MagicDomino.h	(revision 1906)
+++ trunk/MagicSoft/Mars/mtools/MagicDomino.h	(revision 1907)
@@ -96,5 +96,5 @@
     void ChangeCamera(); //*MENU*
 
-    ClassDef(MagicDomino, 0) // Tool to visualize next neighbours
+    ClassDef(MagicDomino, 0) // Magic Camera Games: Some kind of Domino
 };
 
Index: trunk/MagicSoft/Mars/mtools/MagicReversi.cc
===================================================================
--- trunk/MagicSoft/Mars/mtools/MagicReversi.cc	(revision 1906)
+++ trunk/MagicSoft/Mars/mtools/MagicReversi.cc	(revision 1907)
@@ -33,8 +33,25 @@
 //   MagicReversi reversi;
 //
+//  Rules:
+//  ------
+//
+// Use the mouse to put a stone at some place. If between your newly
+// placed stone and the next stone (in a row) of your color are stones
+// of other colors this stones are won by you. You can only place a
+// stone if you win at least one stone from your 'enemy'. If you
+// cannot do so, you are skipped. If nobody can make a move anymore
+// the game is over. The player has won who has the most stones in
+// his own color.
+// The present player is indicated by <*>
+// Use the Escape key to abort a game.
+// If the game was aborted or has been stopped youcan access the
+// options in the context menu.
+//
 ////////////////////////////////////////////////////////////////////////////
 #include "MagicReversi.h"
 
 #include <iostream.h>
+
+#include <KeySymbols.h>
 
 #include <TText.h>
@@ -168,5 +185,5 @@
     : fGeomCam(NULL), fDone(NULL), fW(0), fH(0), fDrawingPad(NULL), fIsAllocated(kFALSE)
 {
-    SetNewCamera(new MGeomCamCT1);
+    SetNewCamera(new MGeomCamMagic);
 
     //
@@ -177,4 +194,6 @@
     SetBit(kCanDelete);
     gInterpreter->DeleteGlobal(this);
+
+    fNumUsers = 2;
 
     Draw();
@@ -317,5 +336,6 @@
 void MagicReversi::Update()
 {
-    for (int i=0; i<fNumUsers; i++)
+    int i;
+    for (i=0; i<fNumUsers; i++)
     {
         TString txt = "Pixels: ";
@@ -327,4 +347,36 @@
         fUsrTxt[i]->SetText(-fRange*0.95, fRange-(i+1)*fRange*0.06, txt);
     }
+    for (; i<6; i++)
+        fUsrTxt[i]->SetText(0, 0, "");
+}
+
+void MagicReversi::TwoPlayer()
+{
+    fNumUsers = 2;
+    Reset();
+}
+
+void MagicReversi::ThreePlayer()
+{
+    fNumUsers = 3;
+    Reset();
+}
+
+void MagicReversi::FourPlayer()
+{
+    fNumUsers = 4;
+    Reset();
+}
+
+void MagicReversi::FivePlayer()
+{
+    fNumUsers = 5;
+    Reset();
+}
+
+void MagicReversi::SixPlayer()
+{
+    fNumUsers = 6;
+    Reset();
 }
 
@@ -352,5 +404,4 @@
     }
 
-    fNumUsers = 2; // not more than 6!
     fNumUser  = 0;
 
@@ -387,5 +438,5 @@
 
     TString txt = "Player #";
-    txt += winner;
+    txt += winner+1;
     txt += " wins (";
     txt += max;
@@ -523,4 +574,12 @@
         return;
 
+    if (event==kKeyPress && py==kKey_Escape)
+    {
+        Done();
+        fDrawingPad->Modified();
+        fDrawingPad->Update();
+        return;
+    }
+
     UInt_t idx;
     for (idx=0; idx<fNumPixels; idx++)
@@ -547,10 +606,13 @@
         while (!CheckMoves())
         {
-            cout << "Sorry, no moves possible!" << endl;
+            cout << "Sorry, no moves possible for player #" << fNumUser << endl;
             fNumUser++;
             fNumUser%=fNumUsers;
 
             if (fNumUser==start)
+            {
                 Done();
+                break;
+            }
         }
 
@@ -559,72 +621,3 @@
 
     fDrawingPad->Modified();
-
-    /*
-    if (event==kKeyPress && py==0x1000)
-    {
-        Reset();
-        return;
-    }
-    */
-    /*
-    UInt_t idx;
-    for (idx=0; idx<fNumPixels; idx++)
-        if ((*fPixels)[idx]->DistancetoPrimitive(px, py)==0)
-            break;
-
-    if (idx==fNumPixels)
-        return;
-
-    MGeomPix &pix=(*fGeomCam)[idx];
-
-    if (event==kButton1Double)
-    {
-        OpenHexagon(idx);
-
-        if (pix.TestBit(kHasBomb))
-            Done("Argh... you hit the Bomb!!!", kRed);
-    }
-
-    if (event==kButton1Down && !pix.TestBit(kIsVisible))
-    {
-        if (pix.TestBit(kHasFlag))
-            Remove(GetFlag(idx));
-        else
-            GetFlag(idx)->Draw();
-
-        pix.InvertBit(kHasFlag);
-    }
-
-    UInt_t vis=fNumBombs;
-    UInt_t flg=fNumBombs;
-    for (UInt_t i=0; i<fNumPixels; i++)
-    {
-        if ((*fGeomCam)[i].TestBit(kIsVisible))
-            vis++;
-        if ((*fGeomCam)[i].TestBit(kHasFlag))
-            flg--;
-    }
-
-    Update(flg);
-
-    if (vis==fNumPixels && !fDone)
-        Done("Great! Congratulations, you did it!", kGreen);
-
-    fDrawingPad->Modified();
-      */
-    /*
-     switch (event)
-     {
-     case kNoEvent:       cout << "No Event" << endl; break;
-     case kButton1Down:   cout << "Button 1 down" << endl; break;
-     case kButton2Down:   cout << "Button 2 down" << endl; break;
-     case kButton3Down:   cout << "Button 3 down" << endl; break;
-     case kKeyDown:       cout << "Key down" << endl; break;
-     case kKeyUp:         cout << "Key up" << endl; break;
-     case kKeyPress:      cout << "Key press" << endl; break;
-     case kButton1Locate: cout << "Button 1 locate" << endl; break;
-     case kButton2Locate: cout << "Button 2 locate" << endl; break;
-     case kButton3Locate: cout << "Button 3 locate" << endl; break;
-    }
-    */
-}
+}
Index: trunk/MagicSoft/Mars/mtools/MagicReversi.h
===================================================================
--- trunk/MagicSoft/Mars/mtools/MagicReversi.h	(revision 1906)
+++ trunk/MagicSoft/Mars/mtools/MagicReversi.h	(revision 1907)
@@ -87,6 +87,11 @@
     void Reset();        //*MENU*
     void ChangeCamera(); //*MENU*
+    void TwoPlayer(); //*MENU*
+    void ThreePlayer(); //*MENU*
+    void FourPlayer(); //*MENU*
+    void FivePlayer(); //*MENU*
+    void SixPlayer(); //*MENU*
 
-    ClassDef(MagicReversi, 0) // Magic Camera Games
+    ClassDef(MagicReversi, 0) // Magic Camera Games: Reversi
 };
 
Index: trunk/MagicSoft/Mars/mtools/MagicSnake.h
===================================================================
--- trunk/MagicSoft/Mars/mtools/MagicSnake.h	(revision 1906)
+++ trunk/MagicSoft/Mars/mtools/MagicSnake.h	(revision 1907)
@@ -96,5 +96,5 @@
     void ChangeCamera(); //*MENU*
 
-    ClassDef(MagicSnake, 0) // Magic Camera Games
+    ClassDef(MagicSnake, 0) // Magic Camera Games: Snake
 };
 
Index: trunk/MagicSoft/Mars/mtools/MineSweeper.h
===================================================================
--- trunk/MagicSoft/Mars/mtools/MineSweeper.h	(revision 1906)
+++ trunk/MagicSoft/Mars/mtools/MineSweeper.h	(revision 1907)
@@ -73,5 +73,5 @@
     void ChangeCamera(); //*MENU*
 
-    ClassDef(MineSweeper, 0) // Magic Camera Games
+    ClassDef(MineSweeper, 0) // Magic Camera Games: Mine Sweeper
 };
 
