camino-devel
[Top][All Lists]
Advanced

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

[Camino-devel] camino/src/client Game.cpp


From: Philippe Fremy
Subject: [Camino-devel] camino/src/client Game.cpp
Date: Thu, 27 Feb 2003 08:37:30 -0500

CVSROOT:        /cvsroot/camino
Module name:    camino
Changes by:     Philippe Fremy <address@hidden> 03/02/27 08:37:30

Modified files:
        src/client     : Game.cpp 

Log message:
        few comments

Patches:
Index: camino/src/client/Game.cpp
diff -u camino/src/client/Game.cpp:1.17 camino/src/client/Game.cpp:1.18
--- camino/src/client/Game.cpp:1.17     Thu Feb 27 05:20:09 2003
+++ camino/src/client/Game.cpp  Thu Feb 27 08:37:30 2003
@@ -2,7 +2,7 @@
 **
 ** Camino
 **
-** Version : $Id: Game.cpp,v 1.17 2003/02/27 10:20:09 pfremy Exp $
+** Version : $Id: Game.cpp,v 1.18 2003/02/27 13:37:30 pfremy Exp $
 **
 ** Author(s) : Philippe Fremy, Pascal Audoux
 ** Creation : 15/01/2003
@@ -61,10 +61,9 @@
 
        _playerLabel = new QLabel( "Not connected", vbox );
        _playerLabel->setAlignment( AlignHCenter );
-       slot_clientConnected( false ); // sets the text of the label
+       slot_clientConnected( false ); // sets the text of the player label
 
        QHBox * hbox = new QHBox( vbox );
-       hbox->setSpacing( 10 );
        _presentation = new TilePresentation( hbox );
        BoardView * boardView = new BoardView( _board, hbox );
        _actions = new ActionList( hbox );
@@ -73,13 +72,12 @@
        connect( _chat, SIGNAL( sig_message( const QString & ) ), SLOT( 
slot_chatMessage( const QString & ) ) );
        connect( this, SIGNAL( sig_connected( bool ) ), SLOT( 
slot_clientConnected( bool ) ) );
 
-       connect( _presentation, SIGNAL( sig_tile( int ) ), SLOT( slot_tile( int 
) ) );
        connect( _actions, SIGNAL( sig_play() ), SLOT( slot_play() ) );
        connect( _actions, SIGNAL( sig_complete() ), SLOT( slot_complete() ) );
        connect( _actions, SIGNAL( sig_trash() ), SLOT( slot_trash() ) );
        connect( _actions, SIGNAL( sig_undo() ), SLOT( slot_undo() ) );
 
-       connect( boardView, SIGNAL( sig_tile( int, int ) ), SLOT( slot_tile( 
int, int ) ) );
+       connect( boardView, SIGNAL( sig_tileClicked( int, int ) ), SLOT( 
slot_tileClickedInBoard( int, int ) ) );
 }
 
 Game::~Game()
@@ -129,11 +127,6 @@
        _board->addTile( tile );
 }
 
-void Game::slot_tile( int /* tile */ )
-{
-
-}
-
 void Game::slot_play()
 {
        // play something
@@ -149,9 +142,15 @@
 
 }
 
-void Game::slot_tile( int row, int col )
+void Game::slot_tileClickedInBoard( int row, int col )
 {
-       printf( "%d %d\n", row, col );
+       // check if we have one tile selected in tile presentation
+       // check if it is our turn to play
+       // check if there is no tile at this place
+       // check if the rule allow to play here
+       // if all the check pass, send the tile to the server
+       // if the server accepts the move, he will send us a message to add the
+       // tile to the board.
 }
 
 void Game::slot_clientConnected( bool state )
@@ -230,7 +229,7 @@
 
 void Game::recvTilesForYou( Tile::TileType tile )
 {
-       qDebug( "Game::recvTile - %d", ( int )tile );
+//     qDebug( "Game::recvTile - %d", ( int )tile );
        _presentation->addTile( tile );
 }
 




reply via email to

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